// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// The [CreateApi][google.cloud.apihub.v1.ApiHub.CreateApi] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateApi]: crate::client::ApiHub::create_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateApiRequest {
    /// Required. The parent resource for the API resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the API resource, which will become the final
    /// component of the API's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another API resource in the API hub.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, and valid characters
    /// are /[a-z][A-Z][0-9]-_/.
    pub api_id: std::string::String,

    /// Required. The API resource to create.
    pub api: std::option::Option<crate::model::Api>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateApiRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [api_id][crate::model::CreateApiRequest::api_id].
    pub fn set_api_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_id = v.into();
        self
    }

    /// Sets the value of [api][crate::model::CreateApiRequest::api].
    pub fn set_api<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Api>,
    {
        self.api = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api][crate::model::CreateApiRequest::api].
    pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Api>,
    {
        self.api = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateApiRequest"
    }
}

/// The [GetApi][google.cloud.apihub.v1.ApiHub.GetApi] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.GetApi]: crate::client::ApiHub::get_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetApiRequest {
    /// Required. The name of the API resource to retrieve.
    /// Format: `projects/{project}/locations/{location}/apis/{api}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetApiRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetApiRequest"
    }
}

/// The [UpdateApi][google.cloud.apihub.v1.ApiHub.UpdateApi] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateApi]: crate::client::ApiHub::update_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateApiRequest {
    /// Required. The API resource to update.
    ///
    /// The API resource's `name` field is used to identify the API resource to
    /// update.
    /// Format: `projects/{project}/locations/{location}/apis/{api}`
    pub api: std::option::Option<crate::model::Api>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [api][crate::model::UpdateApiRequest::api].
    pub fn set_api<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Api>,
    {
        self.api = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api][crate::model::UpdateApiRequest::api].
    pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Api>,
    {
        self.api = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateApiRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateApiRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateApiRequest"
    }
}

/// The [DeleteApi][google.cloud.apihub.v1.ApiHub.DeleteApi] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteApi]: crate::client::ApiHub::delete_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteApiRequest {
    /// Required. The name of the API resource to delete.
    /// Format: `projects/{project}/locations/{location}/apis/{api}`
    pub name: std::string::String,

    /// Optional. If set to true, any versions from this API will also be deleted.
    /// Otherwise, the request will only work if the API has no versions.
    pub force: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteApiRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [force][crate::model::DeleteApiRequest::force].
    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.force = v.into();
        self
    }
}

impl wkt::message::Message for DeleteApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteApiRequest"
    }
}

/// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.ListApis]: crate::client::ApiHub::list_apis
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListApisRequest {
    /// Required. The parent, which owns this collection of API resources.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of ApiResources.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. The
    /// comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
    /// case sensitive.
    ///
    /// The following fields in the `ApiResource` are eligible for filtering:
    ///
    /// * `owner.email` - The email of the team which owns the ApiResource.
    ///   Allowed comparison operators: `=`.
    /// * `create_time` - The time at which the ApiResource was created. The
    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    /// * `display_name` - The display name of the ApiResource. Allowed
    ///   comparison operators: `=`.
    /// * `target_user.enum_values.values.id` - The allowed value id of the
    ///   target users attribute associated with the ApiResource. Allowed
    ///   comparison operator is `:`.
    /// * `target_user.enum_values.values.display_name` - The allowed value
    ///   display name of the target users attribute associated with the
    ///   ApiResource. Allowed comparison operator is `:`.
    /// * `team.enum_values.values.id` - The allowed value id of the team
    ///   attribute associated with the ApiResource. Allowed comparison operator is
    ///   `:`.
    /// * `team.enum_values.values.display_name` - The allowed value display name
    ///   of the team attribute associated with the ApiResource. Allowed comparison
    ///   operator is `:`.
    /// * `business_unit.enum_values.values.id` - The allowed value id of the
    ///   business unit attribute associated with the ApiResource. Allowed
    ///   comparison operator is `:`.
    /// * `business_unit.enum_values.values.display_name` - The allowed value
    ///   display name of the business unit attribute associated with the
    ///   ApiResource. Allowed comparison operator is `:`.
    /// * `maturity_level.enum_values.values.id` - The allowed value id of the
    ///   maturity level attribute associated with the ApiResource. Allowed
    ///   comparison operator is `:`.
    /// * `maturity_level.enum_values.values.display_name` - The allowed value
    ///   display name of the maturity level attribute associated with the
    ///   ApiResource. Allowed comparison operator is `:`.
    /// * `api_style.enum_values.values.id` - The allowed value id of the
    ///   api style attribute associated with the ApiResource. Allowed
    ///   comparison operator is `:`.
    /// * `api_style.enum_values.values.display_name` - The allowed value display
    ///   name of the api style attribute associated with the ApiResource. Allowed
    ///   comparison operator is `:`.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
    ///   allowed value id of the user defined enum attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
    ///   any user defined enum attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
    ///
    /// - The allowed value display name of the user defined enum attribute
    ///   associated with the Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-display-name is a placeholder that can be
    ///   replaced with any user defined enum attribute enum name.
    ///
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.string_values.values` - The
    ///   allowed value of the user defined string attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-string is a placeholder that can be replaced with
    ///   any user defined string attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.json_values.values` - The
    ///   allowed value of the user defined JSON attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-json is a placeholder that can be replaced with
    ///   any user defined JSON attribute name.
    ///
    /// A filter function is also supported in the filter string. The filter
    /// function is `id(name)`. The `id(name)` function returns the id of the
    /// resource name. For example, `id(name) = \"api-1\"` is equivalent to
    /// `name = \"projects/test-project-id/locations/test-location-id/apis/api-1\"`
    /// provided the parent is
    /// `projects/test-project-id/locations/test-location-id`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are supported. At most
    /// three filter fields are allowed in the filter string and if provided
    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `owner.email = \"apihub@google.com\"` -  - The owner team email is
    ///   _apihub@google.com_.
    /// * `owner.email = \"apihub@google.com\" AND create_time <
    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
    ///   The owner team email is _apihub@google.com_ and the api was created
    ///   before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
    /// * `owner.email = \"apihub@google.com\" OR team.enum_values.values.id:
    ///   apihub-team-id` - The filter string specifies the APIs where the owner
    ///   team email is _apihub@google.com_ or the id of the allowed value
    ///   associated with the team attribute is _apihub-team-id_.
    /// * `owner.email = \"apihub@google.com\" OR
    ///   team.enum_values.values.display_name: ApiHub Team` - The filter string
    ///   specifies the APIs where the owner team email is _apihub@google.com_ or
    ///   the display name of the allowed value associated with the team attribute
    ///   is `ApiHub Team`.
    /// * `owner.email = \"apihub@google.com\" AND
    ///   attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.enum_values.values.id:
    ///   test_enum_id AND
    ///   attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/1765\0f90-4a29-5431-b3d0-d5532da3764c.string_values.values:
    ///   test_string_value`  - The filter string specifies the APIs where the
    ///   owner team email is _apihub@google.com_ and the id of the allowed value
    ///   associated with the user defined attribute of type enum is _test_enum_id_
    ///   and the value of the user defined attribute of type string is _test_..
    pub filter: std::string::String,

    /// Optional. The maximum number of API resources to return. The service may
    /// return fewer than this value. If unspecified, at most 50 Apis will be
    /// returned. The maximum value is 1000; values above 1000 will be coerced to
    /// 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListApis` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListApis` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListApisRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListApisRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListApisRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListApisRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListApisRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListApisRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListApisRequest"
    }
}

/// The [ListApis][google.cloud.apihub.v1.ApiHub.ListApis] method's response.
///
/// [google.cloud.apihub.v1.ApiHub.ListApis]: crate::client::ApiHub::list_apis
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListApisResponse {
    /// The API resources present in the API hub.
    pub apis: std::vec::Vec<crate::model::Api>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListApisResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [apis][crate::model::ListApisResponse::apis].
    pub fn set_apis<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Api>,
    {
        use std::iter::Iterator;
        self.apis = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListApisResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListApisResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListApisResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListApisResponse {
    type PageItem = crate::model::Api;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.apis
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [CreateVersion][google.cloud.apihub.v1.ApiHub.CreateVersion] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateVersion]: crate::client::ApiHub::create_version
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateVersionRequest {
    /// Required. The parent resource for API version.
    /// Format: `projects/{project}/locations/{location}/apis/{api}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the API version, which will become the final
    /// component of the version's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another version in the API resource.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, overall resource name which will be
    /// of format
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`,
    /// its length is limited to 700 characters and valid characters are
    /// /[a-z][A-Z][0-9]-_/.
    pub version_id: std::string::String,

    /// Required. The version to create.
    pub version: std::option::Option<crate::model::Version>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateVersionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [version_id][crate::model::CreateVersionRequest::version_id].
    pub fn set_version_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.version_id = v.into();
        self
    }

    /// Sets the value of [version][crate::model::CreateVersionRequest::version].
    pub fn set_version<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Version>,
    {
        self.version = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Version>,
    {
        self.version = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateVersionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateVersionRequest"
    }
}

/// The [GetVersion][google.cloud.apihub.v1.ApiHub.GetVersion] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.GetVersion]: crate::client::ApiHub::get_version
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetVersionRequest {
    /// Required. The name of the API version to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetVersionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetVersionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetVersionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetVersionRequest"
    }
}

/// The [UpdateVersion][google.cloud.apihub.v1.ApiHub.UpdateVersion] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateVersion]: crate::client::ApiHub::update_version
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateVersionRequest {
    /// Required. The API version to update.
    ///
    /// The version's `name` field is used to identify the API version to update.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub version: std::option::Option<crate::model::Version>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateVersionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
    pub fn set_version<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Version>,
    {
        self.version = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Version>,
    {
        self.version = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateVersionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateVersionRequest"
    }
}

/// The [DeleteVersion][google.cloud.apihub.v1.ApiHub.DeleteVersion] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteVersion]: crate::client::ApiHub::delete_version
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteVersionRequest {
    /// Required. The name of the version to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub name: std::string::String,

    /// Optional. If set to true, any specs from this version will also be deleted.
    /// Otherwise, the request will only work if the version has no specs.
    pub force: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteVersionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [force][crate::model::DeleteVersionRequest::force].
    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.force = v.into();
        self
    }
}

impl wkt::message::Message for DeleteVersionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteVersionRequest"
    }
}

/// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.ListVersions]: crate::client::ApiHub::list_versions
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListVersionsRequest {
    /// Required. The parent which owns this collection of API versions i.e., the
    /// API resource Format: `projects/{project}/locations/{location}/apis/{api}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of Versions.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string, a
    /// number, or a boolean. The comparison operator must be one of: `<`, `>` or
    /// `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `Version` are eligible for filtering:
    ///
    /// * `display_name` - The display name of the Version. Allowed
    ///   comparison operators: `=`.
    /// * `create_time` - The time at which the Version was created. The
    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    /// * `lifecycle.enum_values.values.id` - The allowed value id of the
    ///   lifecycle attribute associated with the Version. Allowed comparison
    ///   operators: `:`.
    /// * `lifecycle.enum_values.values.display_name` - The allowed value display
    ///   name of the lifecycle attribute associated with the Version. Allowed
    ///   comparison operators: `:`.
    /// * `compliance.enum_values.values.id` -  The allowed value id of the
    ///   compliances attribute associated with the Version. Allowed comparison
    ///   operators: `:`.
    /// * `compliance.enum_values.values.display_name` -  The allowed value
    ///   display name of the compliances attribute associated with the Version.
    ///   Allowed comparison operators: `:`.
    /// * `accreditation.enum_values.values.id` - The allowed value id of the
    ///   accreditations attribute associated with the Version. Allowed
    ///   comparison operators: `:`.
    /// * `accreditation.enum_values.values.display_name` - The allowed value
    ///   display name of the accreditations attribute associated with the Version.
    ///   Allowed comparison operators: `:`.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
    ///   allowed value id of the user defined enum attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
    ///   any user defined enum attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
    ///
    /// - The allowed value display name of the user defined enum attribute
    ///   associated with the Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-display-name is a placeholder that can be
    ///   replaced with any user defined enum attribute enum name.
    ///
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.string_values.values` - The
    ///   allowed value of the user defined string attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-string is a placeholder that can be replaced with
    ///   any user defined string attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.json_values.values` - The
    ///   allowed value of the user defined JSON attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-json is a placeholder that can be replaced with
    ///   any user defined JSON attribute name.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are
    /// supported. At most three filter fields are allowed in the filter
    /// string and if provided more than that then `INVALID_ARGUMENT` error is
    /// returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `lifecycle.enum_values.values.id: preview-id` - The filter string
    ///   specifies that the id of the allowed value associated with the lifecycle
    ///   attribute of the Version is _preview-id_.
    /// * `lifecycle.enum_values.values.display_name: \"Preview Display Name\"` -
    ///   The filter string specifies that the display name of the allowed value
    ///   associated with the lifecycle attribute of the Version is `Preview
    ///   Display Name`.
    /// * `lifecycle.enum_values.values.id: preview-id AND create_time <
    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
    ///   The id of the allowed value associated with the lifecycle attribute of
    ///   the Version is _preview-id_ and it was created before _2021-08-15
    ///   14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
    /// * `compliance.enum_values.values.id: gdpr-id OR
    ///   compliance.enum_values.values.id: pci-dss-id`
    ///
    /// - The id of the allowed value associated with the compliance attribute is
    ///   _gdpr-id_ or _pci-dss-id_.
    ///
    /// * `lifecycle.enum_values.values.id: preview-id AND
    ///   attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.string_values.values:
    ///   test`  - The filter string specifies that the id of the allowed value
    ///   associated with the lifecycle attribute of the Version is _preview-id_
    ///   and the value of the user defined attribute of type string is _test_.
    pub filter: std::string::String,

    /// Optional. The maximum number of versions to return. The service may return
    /// fewer than this value. If unspecified, at most 50 versions will be
    /// returned. The maximum value is 1000; values above 1000 will be coerced to
    /// 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListVersions` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListVersions` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListVersionsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListVersionsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListVersionsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListVersionsRequest"
    }
}

/// The [ListVersions][google.cloud.apihub.v1.ApiHub.ListVersions] method's
/// response.
///
/// [google.cloud.apihub.v1.ApiHub.ListVersions]: crate::client::ApiHub::list_versions
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListVersionsResponse {
    /// The versions corresponding to an API.
    pub versions: std::vec::Vec<crate::model::Version>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListVersionsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [versions][crate::model::ListVersionsResponse::versions].
    pub fn set_versions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Version>,
    {
        use std::iter::Iterator;
        self.versions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListVersionsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListVersionsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListVersionsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListVersionsResponse {
    type PageItem = crate::model::Version;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.versions
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [CreateSpec][google.cloud.apihub.v1.ApiHub.CreateSpec] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateSpec]: crate::client::ApiHub::create_spec
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSpecRequest {
    /// Required. The parent resource for Spec.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the spec, which will become the final component
    /// of the spec's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another spec in the API
    ///   resource.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, overall resource name which will be
    /// of format
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`,
    /// its length is limited to 1000 characters and valid characters are
    /// /[a-z][A-Z][0-9]-_/.
    pub spec_id: std::string::String,

    /// Required. The spec to create.
    pub spec: std::option::Option<crate::model::Spec>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateSpecRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateSpecRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [spec_id][crate::model::CreateSpecRequest::spec_id].
    pub fn set_spec_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spec_id = v.into();
        self
    }

    /// Sets the value of [spec][crate::model::CreateSpecRequest::spec].
    pub fn set_spec<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spec>,
    {
        self.spec = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spec][crate::model::CreateSpecRequest::spec].
    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spec>,
    {
        self.spec = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateSpecRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateSpecRequest"
    }
}

/// The [GetSpec][google.cloud.apihub.v1.ApiHub.GetSpec] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.GetSpec]: crate::client::ApiHub::get_spec
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpecRequest {
    /// Required. The name of the spec to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetSpecRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetSpecRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetSpecRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetSpecRequest"
    }
}

/// The [UpdateSpec][google.cloud.apihub.v1.ApiHub.UpdateSpec] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateSpec]: crate::client::ApiHub::update_spec
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSpecRequest {
    /// Required. The spec to update.
    ///
    /// The spec's `name` field is used to identify the spec to
    /// update. Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub spec: std::option::Option<crate::model::Spec>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateSpecRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spec][crate::model::UpdateSpecRequest::spec].
    pub fn set_spec<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spec>,
    {
        self.spec = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spec][crate::model::UpdateSpecRequest::spec].
    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spec>,
    {
        self.spec = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateSpecRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateSpecRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateSpecRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateSpecRequest"
    }
}

/// The [DeleteSpec][google.cloud.apihub.v1.ApiHub.DeleteSpec] method's request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteSpec]: crate::client::ApiHub::delete_spec
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSpecRequest {
    /// Required. The name of the spec  to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteSpecRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteSpecRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteSpecRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteSpecRequest"
    }
}

/// The [ListSpecs][ListSpecs] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpecsRequest {
    /// Required. The parent, which owns this collection of specs.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of Specs.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. The
    /// comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are not
    /// case sensitive.
    ///
    /// The following fields in the `Spec` are eligible for filtering:
    ///
    /// * `display_name` - The display name of the Spec. Allowed comparison
    ///   operators: `=`.
    /// * `create_time` - The time at which the Spec was created. The
    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    /// * `spec_type.enum_values.values.id` - The allowed value id of the
    ///   spec_type attribute associated with the Spec. Allowed comparison
    ///   operators: `:`.
    /// * `spec_type.enum_values.values.display_name` - The allowed value display
    ///   name of the spec_type attribute associated with the Spec. Allowed
    ///   comparison operators: `:`.
    /// * `lint_response.json_values.values` - The json value of the
    ///   lint_response attribute associated with the Spec. Allowed comparison
    ///   operators: `:`.
    /// * `mime_type` - The MIME type of the Spec. Allowed comparison
    ///   operators: `=`.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
    ///   allowed value id of the user defined enum attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
    ///   any user defined enum attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
    ///
    /// - The allowed value display name of the user defined enum attribute
    ///   associated with the Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-display-name is a placeholder that can be
    ///   replaced with any user defined enum attribute enum name.
    ///
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.string_values.values` - The
    ///   allowed value of the user defined string attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-string is a placeholder that can be replaced with
    ///   any user defined string attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.json_values.values` - The
    ///   allowed value of the user defined JSON attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-json is a placeholder that can be replaced with
    ///   any user defined JSON attribute name.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are
    /// supported. At most three filter fields are allowed in the filter
    /// string and if provided more than that then `INVALID_ARGUMENT` error is
    /// returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `spec_type.enum_values.values.id: rest-id` -  The filter
    ///   string specifies that the id of the allowed value associated with the
    ///   spec_type attribute is _rest-id_.
    /// * `spec_type.enum_values.values.display_name: \"Rest Display Name\"` -
    ///   The filter string specifies that the display name of the allowed value
    ///   associated with the spec_type attribute is `Rest Display Name`.
    /// * `spec_type.enum_values.values.id: grpc-id AND create_time <
    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
    ///   The id of the allowed value associated with the spec_type attribute is
    ///   _grpc-id_ and the spec was created before _2021-08-15 14:50:00 UTC_ and
    ///   after _2021-08-10 12:00:00 UTC_.
    /// * `spec_type.enum_values.values.id: rest-id OR
    ///   spec_type.enum_values.values.id: grpc-id`
    ///
    /// - The id of the allowed value associated with the spec_type attribute is
    ///   _rest-id_ or _grpc-id_.
    ///
    /// * `spec_type.enum_values.values.id: rest-id AND
    ///   attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.enum_values.values.id:
    ///   test`  - The filter string specifies that the id of the allowed value
    ///   associated with the spec_type attribute is _rest-id_ and the id of the
    ///   allowed value associated with the user defined attribute of type enum is
    ///   _test_.
    pub filter: std::string::String,

    /// Optional. The maximum number of specs to return. The service may return
    /// fewer than this value. If unspecified, at most 50 specs will be
    /// returned. The maximum value is 1000; values above 1000 will be coerced to
    /// 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListSpecs` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListSpecs` must
    /// match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListSpecsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListSpecsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListSpecsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListSpecsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListSpecsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListSpecsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListSpecsRequest"
    }
}

/// The [ListSpecs][google.cloud.apihub.v1.ApiHub.ListSpecs] method's response.
///
/// [google.cloud.apihub.v1.ApiHub.ListSpecs]: crate::client::ApiHub::list_specs
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpecsResponse {
    /// The specs corresponding to an API Version.
    pub specs: std::vec::Vec<crate::model::Spec>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListSpecsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [specs][crate::model::ListSpecsResponse::specs].
    pub fn set_specs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Spec>,
    {
        use std::iter::Iterator;
        self.specs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListSpecsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListSpecsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListSpecsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListSpecsResponse {
    type PageItem = crate::model::Spec;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.specs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [GetSpecContents][google.cloud.apihub.v1.ApiHub.GetSpecContents] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.GetSpecContents]: crate::client::ApiHub::get_spec_contents
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpecContentsRequest {
    /// Required. The name of the spec whose contents need to be retrieved.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetSpecContentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetSpecContentsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetSpecContentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetSpecContentsRequest"
    }
}

/// The [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateApiOperationRequest {
    /// Required. The parent resource for the operation resource.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the operation resource, which will become the
    /// final component of the operation's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another operation resource in the API
    ///   hub.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, overall resource name which
    /// will be of format
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`,
    /// its length is limited to 700 characters, and valid characters are
    /// /[a-z][A-Z][0-9]-_/.
    pub api_operation_id: std::string::String,

    /// Required. The operation resource to create.
    pub api_operation: std::option::Option<crate::model::ApiOperation>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateApiOperationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateApiOperationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [api_operation_id][crate::model::CreateApiOperationRequest::api_operation_id].
    pub fn set_api_operation_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.api_operation_id = v.into();
        self
    }

    /// Sets the value of [api_operation][crate::model::CreateApiOperationRequest::api_operation].
    pub fn set_api_operation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ApiOperation>,
    {
        self.api_operation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_operation][crate::model::CreateApiOperationRequest::api_operation].
    pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ApiOperation>,
    {
        self.api_operation = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateApiOperationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateApiOperationRequest"
    }
}

/// The [GetApiOperation][google.cloud.apihub.v1.ApiHub.GetApiOperation] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.GetApiOperation]: crate::client::ApiHub::get_api_operation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetApiOperationRequest {
    /// Required. The name of the operation to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetApiOperationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetApiOperationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetApiOperationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetApiOperationRequest"
    }
}

/// The [UpdateApiOperation][google.cloud.apihub.v1.ApiHub.UpdateApiOperation]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateApiOperation]: crate::client::ApiHub::update_api_operation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateApiOperationRequest {
    /// Required. The apiOperation resource to update.
    ///
    /// The operation resource's `name` field is used to identify the operation
    /// resource to update.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
    pub api_operation: std::option::Option<crate::model::ApiOperation>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateApiOperationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [api_operation][crate::model::UpdateApiOperationRequest::api_operation].
    pub fn set_api_operation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ApiOperation>,
    {
        self.api_operation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_operation][crate::model::UpdateApiOperationRequest::api_operation].
    pub fn set_or_clear_api_operation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ApiOperation>,
    {
        self.api_operation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateApiOperationRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateApiOperationRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateApiOperationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateApiOperationRequest"
    }
}

/// The [DeleteApiOperation][google.cloud.apihub.v1.ApiHub.DeleteApiOperation]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteApiOperation]: crate::client::ApiHub::delete_api_operation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteApiOperationRequest {
    /// Required. The name of the operation resource to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteApiOperationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteApiOperationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteApiOperationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteApiOperationRequest"
    }
}

/// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.ListApiOperations]: crate::client::ApiHub::list_api_operations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListApiOperationsRequest {
    /// Required. The parent which owns this collection of operations i.e., the API
    /// version. Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of ApiOperations.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string or a
    /// boolean. The comparison operator must be one of: `<`, `>` or
    /// `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `ApiOperation` are eligible for filtering:
    ///
    /// * `name` - The ApiOperation resource name. Allowed comparison
    ///   operators:
    ///   `=`.
    /// * `details.http_operation.path.path` - The http operation's complete path
    ///   relative to server endpoint. Allowed comparison operators: `=`.
    /// * `details.http_operation.method` - The http operation method type.
    ///   Allowed comparison operators: `=`.
    /// * `details.deprecated` - Indicates if the ApiOperation is deprecated.
    ///   Allowed values are True / False indicating the deprycation status of the
    ///   ApiOperation. Allowed comparison operators: `=`.
    /// * `create_time` - The time at which the ApiOperation was created. The
    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
    ///   allowed value id of the user defined enum attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
    ///   any user defined enum attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
    ///
    /// - The allowed value display name of the user defined enum attribute
    ///   associated with the Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-display-name is a placeholder that can be
    ///   replaced with any user defined enum attribute enum name.
    ///
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.string_values.values` - The
    ///   allowed value of the user defined string attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-string is a placeholder that can be replaced with
    ///   any user defined string attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.json_values.values` - The
    ///   allowed value of the user defined JSON attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-json is a placeholder that can be replaced with
    ///   any user defined JSON attribute name.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are supported. At most
    /// three filter fields are allowed in the filter string and if provided
    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `details.deprecated = True` -  The ApiOperation is deprecated.
    /// * `details.http_operation.method = GET AND create_time <
    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
    ///   The method of the http operation of the ApiOperation is _GET_ and the
    ///   spec was created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10
    ///   12:00:00 UTC_.
    /// * `details.http_operation.method = GET OR details.http_operation.method =
    ///   POST`. - The http operation of the method of ApiOperation is _GET_ or
    ///   _POST_.
    /// * `details.deprecated = True AND
    ///   attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.string_values.values:
    ///   test`  - The filter string specifies that the ApiOperation is deprecated
    ///   and the value of the user defined attribute of type string is _test_.
    pub filter: std::string::String,

    /// Optional. The maximum number of operations to return. The service may
    /// return fewer than this value. If unspecified, at most 50 operations will be
    /// returned. The maximum value is 1000; values above 1000 will be coerced to
    /// 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListApiOperations` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListApiOperations` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListApiOperationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListApiOperationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListApiOperationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListApiOperationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListApiOperationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListApiOperationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListApiOperationsRequest"
    }
}

/// The [ListApiOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHub.ListApiOperations]: crate::client::ApiHub::list_api_operations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListApiOperationsResponse {
    /// The operations corresponding to an API version.
    pub api_operations: std::vec::Vec<crate::model::ApiOperation>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListApiOperationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [api_operations][crate::model::ListApiOperationsResponse::api_operations].
    pub fn set_api_operations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ApiOperation>,
    {
        use std::iter::Iterator;
        self.api_operations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListApiOperationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListApiOperationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListApiOperationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListApiOperationsResponse {
    type PageItem = crate::model::ApiOperation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.api_operations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [GetDefinition][google.cloud.apihub.v1.ApiHub.GetDefinition] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.GetDefinition]: crate::client::ApiHub::get_definition
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDefinitionRequest {
    /// Required. The name of the definition to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDefinitionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDefinitionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDefinitionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetDefinitionRequest"
    }
}

/// The [CreateDeployment][google.cloud.apihub.v1.ApiHub.CreateDeployment]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateDeployment]: crate::client::ApiHub::create_deployment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDeploymentRequest {
    /// Required. The parent resource for the deployment resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the deployment resource, which will become the
    /// final component of the deployment's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another deployment resource in the API
    ///   hub.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, and valid characters
    /// are /[a-z][A-Z][0-9]-_/.
    pub deployment_id: std::string::String,

    /// Required. The deployment resource to create.
    pub deployment: std::option::Option<crate::model::Deployment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateDeploymentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateDeploymentRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [deployment_id][crate::model::CreateDeploymentRequest::deployment_id].
    pub fn set_deployment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.deployment_id = v.into();
        self
    }

    /// Sets the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
    pub fn set_deployment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Deployment>,
    {
        self.deployment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [deployment][crate::model::CreateDeploymentRequest::deployment].
    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Deployment>,
    {
        self.deployment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateDeploymentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateDeploymentRequest"
    }
}

/// The [GetDeployment][google.cloud.apihub.v1.ApiHub.GetDeployment] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.GetDeployment]: crate::client::ApiHub::get_deployment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDeploymentRequest {
    /// Required. The name of the deployment resource to retrieve.
    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDeploymentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDeploymentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetDeploymentRequest"
    }
}

/// The [UpdateDeployment][google.cloud.apihub.v1.ApiHub.UpdateDeployment]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateDeployment]: crate::client::ApiHub::update_deployment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDeploymentRequest {
    /// Required. The deployment resource to update.
    ///
    /// The deployment resource's `name` field is used to identify the deployment
    /// resource to update.
    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
    pub deployment: std::option::Option<crate::model::Deployment>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateDeploymentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
    pub fn set_deployment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Deployment>,
    {
        self.deployment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [deployment][crate::model::UpdateDeploymentRequest::deployment].
    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Deployment>,
    {
        self.deployment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateDeploymentRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateDeploymentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateDeploymentRequest"
    }
}

/// The [DeleteDeployment][google.cloud.apihub.v1.ApiHub.DeleteDeployment]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteDeployment]: crate::client::ApiHub::delete_deployment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDeploymentRequest {
    /// Required. The name of the deployment resource to delete.
    /// Format: `projects/{project}/locations/{location}/deployments/{deployment}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteDeploymentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteDeploymentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteDeploymentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteDeploymentRequest"
    }
}

/// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.ListDeployments]: crate::client::ApiHub::list_deployments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeploymentsRequest {
    /// Required. The parent, which owns this collection of deployment resources.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of Deployments.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. The
    /// comparison operator must be one of: `<`, `>` or
    /// `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `Deployments` are eligible for filtering:
    ///
    /// * `display_name` - The display name of the Deployment. Allowed
    ///   comparison operators: `=`.
    /// * `create_time` - The time at which the Deployment was created. The
    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    /// * `resource_uri` - A URI to the deployment resource. Allowed
    ///   comparison operators: `=`.
    /// * `api_versions` - The API versions linked to this deployment. Allowed
    ///   comparison operators: `:`.
    /// * `source_project` - The project/organization at source for the
    ///   deployment. Allowed comparison operators: `=`.
    /// * `source_environment` - The environment at source for the
    ///   deployment. Allowed comparison operators: `=`.
    /// * `deployment_type.enum_values.values.id` - The allowed value id of the
    ///   deployment_type attribute associated with the Deployment. Allowed
    ///   comparison operators: `:`.
    /// * `deployment_type.enum_values.values.display_name` - The allowed value
    ///   display name of the deployment_type attribute associated with the
    ///   Deployment. Allowed comparison operators: `:`.
    /// * `slo.string_values.values` -The allowed string value of the slo
    ///   attribute associated with the deployment. Allowed comparison
    ///   operators: `:`.
    /// * `environment.enum_values.values.id` - The allowed value id of the
    ///   environment attribute associated with the deployment. Allowed
    ///   comparison operators: `:`.
    /// * `environment.enum_values.values.display_name` - The allowed value
    ///   display name of the environment attribute associated with the deployment.
    ///   Allowed comparison operators: `:`.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.id` - The
    ///   allowed value id of the user defined enum attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-id is a placeholder that can be replaced with
    ///   any user defined enum attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.enum_values.values.display_name`
    ///
    /// - The allowed value display name of the user defined enum attribute
    ///   associated with the Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-enum-display-name is a placeholder that can be
    ///   replaced with any user defined enum attribute enum name.
    ///
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.string_values.values` - The
    ///   allowed value of the user defined string attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-string is a placeholder that can be replaced with
    ///   any user defined string attribute name.
    /// * `attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/user-defined-attribute-id.json_values.values` - The
    ///   allowed value of the user defined JSON attribute associated with the
    ///   Resource. Allowed comparison operator is `:`. Here
    ///   user-defined-attribute-json is a placeholder that can be replaced with
    ///   any user defined JSON attribute name.
    ///
    /// A filter function is also supported in the filter string. The filter
    /// function is `id(name)`. The `id(name)` function returns the id of the
    /// resource name. For example, `id(name) = \"deployment-1\"` is equivalent to
    /// `name =
    /// \"projects/test-project-id/locations/test-location-id/deployments/deployment-1\"`
    /// provided the parent is
    /// `projects/test-project-id/locations/test-location-id`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are supported. At most
    /// three filter fields are allowed in the filter string and if provided
    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `environment.enum_values.values.id: staging-id` - The allowed value id
    ///   of the environment attribute associated with the Deployment is
    ///   _staging-id_.
    /// * `environment.enum_values.values.display_name: \"Staging Deployment\"` -
    ///   The allowed value display name of the environment attribute associated
    ///   with the Deployment is `Staging Deployment`.
    /// * `environment.enum_values.values.id: production-id AND create_time <
    ///   \"2021-08-15T14:50:00Z\" AND create_time > \"2021-08-10T12:00:00Z\"` -
    ///   The allowed value id of the environment attribute associated with the
    ///   Deployment is _production-id_ and Deployment was created before
    ///   _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00 UTC_.
    /// * `environment.enum_values.values.id: production-id OR
    ///   slo.string_values.values: \"99.99%\"`
    ///
    /// - The allowed value id of the environment attribute Deployment is
    ///   _production-id_ or string value of the slo attribute is _99.99%_.
    ///
    /// * `environment.enum_values.values.id: staging-id AND
    ///   attributes.projects/test-project-id/locations/test-location-id/
    ///   attributes/17650f90-4a29-4971-b3c0-d5532da3764b.string_values.values:
    ///   test`  - The filter string specifies that the allowed value id of the
    ///   environment attribute associated with the Deployment is _staging-id_ and
    ///   the value of the user defined attribute of type string is _test_.
    pub filter: std::string::String,

    /// Optional. The maximum number of deployment resources to return. The service
    /// may return fewer than this value. If unspecified, at most 50 deployments
    /// will be returned. The maximum value is 1000; values above 1000 will be
    /// coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListDeployments` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListDeployments` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDeploymentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDeploymentsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDeploymentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDeploymentsRequest"
    }
}

/// The [ListDeployments][google.cloud.apihub.v1.ApiHub.ListDeployments] method's
/// response.
///
/// [google.cloud.apihub.v1.ApiHub.ListDeployments]: crate::client::ApiHub::list_deployments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDeploymentsResponse {
    /// The deployment resources present in the API hub.
    pub deployments: std::vec::Vec<crate::model::Deployment>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDeploymentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [deployments][crate::model::ListDeploymentsResponse::deployments].
    pub fn set_deployments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Deployment>,
    {
        use std::iter::Iterator;
        self.deployments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDeploymentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDeploymentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDeploymentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDeploymentsResponse {
    type PageItem = crate::model::Deployment;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.deployments
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [CreateAttribute][google.cloud.apihub.v1.ApiHub.CreateAttribute] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateAttribute]: crate::client::ApiHub::create_attribute
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAttributeRequest {
    /// Required. The parent resource for Attribute.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the attribute, which will become the final
    /// component of the attribute's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another attribute resource in the API
    ///   hub.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, and valid characters
    /// are /[a-z][A-Z][0-9]-_/.
    pub attribute_id: std::string::String,

    /// Required. The attribute to create.
    pub attribute: std::option::Option<crate::model::Attribute>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateAttributeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateAttributeRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [attribute_id][crate::model::CreateAttributeRequest::attribute_id].
    pub fn set_attribute_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.attribute_id = v.into();
        self
    }

    /// Sets the value of [attribute][crate::model::CreateAttributeRequest::attribute].
    pub fn set_attribute<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Attribute>,
    {
        self.attribute = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [attribute][crate::model::CreateAttributeRequest::attribute].
    pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Attribute>,
    {
        self.attribute = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateAttributeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateAttributeRequest"
    }
}

/// The [GetAttribute][google.cloud.apihub.v1.ApiHub.GetAttribute] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.GetAttribute]: crate::client::ApiHub::get_attribute
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAttributeRequest {
    /// Required. The name of the attribute to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetAttributeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetAttributeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetAttributeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetAttributeRequest"
    }
}

/// The [UpdateAttribute][google.cloud.apihub.v1.ApiHub.UpdateAttribute] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateAttribute]: crate::client::ApiHub::update_attribute
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAttributeRequest {
    /// Required. The attribute to update.
    ///
    /// The attribute's `name` field is used to identify the attribute to update.
    /// Format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`
    pub attribute: std::option::Option<crate::model::Attribute>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateAttributeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [attribute][crate::model::UpdateAttributeRequest::attribute].
    pub fn set_attribute<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Attribute>,
    {
        self.attribute = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [attribute][crate::model::UpdateAttributeRequest::attribute].
    pub fn set_or_clear_attribute<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Attribute>,
    {
        self.attribute = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateAttributeRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateAttributeRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateAttributeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateAttributeRequest"
    }
}

/// The [DeleteAttribute][google.cloud.apihub.v1.ApiHub.DeleteAttribute] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteAttribute]: crate::client::ApiHub::delete_attribute
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteAttributeRequest {
    /// Required. The name of the attribute to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteAttributeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteAttributeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteAttributeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteAttributeRequest"
    }
}

/// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.ListAttributes]: crate::client::ApiHub::list_attributes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAttributesRequest {
    /// Required. The parent resource for Attribute.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of Attributes.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string or a
    /// boolean. The comparison operator must be one of: `<`, `>` or
    /// `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `Attribute` are eligible for filtering:
    ///
    /// * `display_name` - The display name of the Attribute. Allowed
    ///   comparison operators: `=`.
    /// * `definition_type` - The definition type of the attribute. Allowed
    ///   comparison operators: `=`.
    /// * `scope` - The scope of the attribute. Allowed comparison operators:
    ///   `=`.
    /// * `data_type` - The type of the data of the attribute. Allowed
    ///   comparison operators: `=`.
    /// * `mandatory` - Denotes whether the attribute is mandatory or not.
    ///   Allowed comparison operators: `=`.
    /// * `create_time` - The time at which the Attribute was created. The
    ///   value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are
    /// supported. At most three filter fields are allowed in the filter
    /// string and if provided more than that then `INVALID_ARGUMENT` error is
    /// returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `display_name = production` -  - The display name of the attribute is
    ///   _production_.
    /// * `(display_name = production) AND (create_time <
    ///   \"2021-08-15T14:50:00Z\") AND (create_time > \"2021-08-10T12:00:00Z\")` -
    ///   The display name of the attribute is _production_ and the attribute was
    ///   created before _2021-08-15 14:50:00 UTC_ and after _2021-08-10 12:00:00
    ///   UTC_.
    /// * `display_name = production OR scope = api` -
    ///   The attribute where the display name is _production_ or the scope is
    ///   _api_.
    pub filter: std::string::String,

    /// Optional. The maximum number of attribute resources to return. The service
    /// may return fewer than this value. If unspecified, at most 50 attributes
    /// will be returned. The maximum value is 1000; values above 1000 will be
    /// coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListAttributes` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListAttributes` must
    /// match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAttributesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListAttributesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListAttributesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListAttributesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListAttributesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListAttributesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListAttributesRequest"
    }
}

/// The [ListAttributes][google.cloud.apihub.v1.ApiHub.ListAttributes] method's
/// response.
///
/// [google.cloud.apihub.v1.ApiHub.ListAttributes]: crate::client::ApiHub::list_attributes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAttributesResponse {
    /// The list of all attributes.
    pub attributes: std::vec::Vec<crate::model::Attribute>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAttributesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [attributes][crate::model::ListAttributesResponse::attributes].
    pub fn set_attributes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Attribute>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListAttributesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListAttributesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListAttributesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListAttributesResponse {
    type PageItem = crate::model::Attribute;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.attributes
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.SearchResources]: crate::client::ApiHub::search_resources
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchResourcesRequest {
    /// Required. The resource name of the location which will be of the type
    /// `projects/{project_id}/locations/{location_id}`. This field is used to
    /// identify the instance of API-Hub in which resources should be searched.
    pub location: std::string::String,

    /// Required. The free text search query. This query can contain keywords which
    /// could be related to any detail of the API-Hub resources such display names,
    /// descriptions, attributes etc.
    pub query: std::string::String,

    /// Optional. An expression that filters the list of search results.
    ///
    /// A filter expression consists of a field name, a comparison operator,
    /// and a value for filtering. The value must be a string, a number, or a
    /// boolean. The comparison operator must be `=`. Filters are not case
    /// sensitive.
    ///
    /// The following field names are eligible for filtering:
    ///
    /// * `resource_type` - The type of resource in the search results.
    ///   Must be one of the following: `Api`, `ApiOperation`, `Deployment`,
    ///   `Definition`, `Spec` or `Version`. This field can only be specified once
    ///   in the filter.
    ///
    /// Here are is an example:
    ///
    /// * `resource_type = Api` - The resource_type is _Api_.
    pub filter: std::string::String,

    /// Optional. The maximum number of search results to return. The service may
    /// return fewer than this value. If unspecified at most 10 search results will
    /// be returned. If value is negative then `INVALID_ARGUMENT` error is
    /// returned. The maximum value is 25; values above 25 will be coerced to 25.
    /// While paginating, you can specify a new page size parameter for each page
    /// of search results to be listed.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// [SearchResources][SearchResources]
    /// call. Specify this parameter to retrieve the next page of transactions.
    ///
    /// When paginating, you must specify the `page_token` parameter and all the
    /// other parameters except
    /// [page_size][google.cloud.apihub.v1.SearchResourcesRequest.page_size]
    /// should be specified with the same value which was used in the previous
    /// call. If the other fields are set with a different value than the previous
    /// call then `INVALID_ARGUMENT` error is returned.
    ///
    /// [google.cloud.apihub.v1.SearchResourcesRequest.page_size]: crate::model::SearchResourcesRequest::page_size
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchResourcesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [location][crate::model::SearchResourcesRequest::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [query][crate::model::SearchResourcesRequest::query].
    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.query = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::SearchResourcesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::SearchResourcesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::SearchResourcesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for SearchResourcesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SearchResourcesRequest"
    }
}

/// ApiHubResource is one of the resources such as Api, Operation, Deployment,
/// Definition, Spec and Version resources stored in API-Hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiHubResource {
    pub resource: std::option::Option<crate::model::api_hub_resource::Resource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ApiHubResource {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource].
    ///
    /// Note that all the setters affecting `resource` are mutually
    /// exclusive.
    pub fn set_resource<
        T: std::convert::Into<std::option::Option<crate::model::api_hub_resource::Resource>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.resource = v.into();
        self
    }

    /// The value of [resource][crate::model::ApiHubResource::resource]
    /// if it holds a `Api`, `None` if the field is not set or
    /// holds a different branch.
    pub fn api(&self) -> std::option::Option<&std::boxed::Box<crate::model::Api>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::api_hub_resource::Resource::Api(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
    /// to hold a `Api`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_api<T: std::convert::Into<std::boxed::Box<crate::model::Api>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource =
            std::option::Option::Some(crate::model::api_hub_resource::Resource::Api(v.into()));
        self
    }

    /// The value of [resource][crate::model::ApiHubResource::resource]
    /// if it holds a `Operation`, `None` if the field is not set or
    /// holds a different branch.
    pub fn operation(&self) -> std::option::Option<&std::boxed::Box<crate::model::ApiOperation>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::api_hub_resource::Resource::Operation(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
    /// to hold a `Operation`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_operation<T: std::convert::Into<std::boxed::Box<crate::model::ApiOperation>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource = std::option::Option::Some(
            crate::model::api_hub_resource::Resource::Operation(v.into()),
        );
        self
    }

    /// The value of [resource][crate::model::ApiHubResource::resource]
    /// if it holds a `Deployment`, `None` if the field is not set or
    /// holds a different branch.
    pub fn deployment(&self) -> std::option::Option<&std::boxed::Box<crate::model::Deployment>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::api_hub_resource::Resource::Deployment(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
    /// to hold a `Deployment`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_deployment<T: std::convert::Into<std::boxed::Box<crate::model::Deployment>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource = std::option::Option::Some(
            crate::model::api_hub_resource::Resource::Deployment(v.into()),
        );
        self
    }

    /// The value of [resource][crate::model::ApiHubResource::resource]
    /// if it holds a `Spec`, `None` if the field is not set or
    /// holds a different branch.
    pub fn spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::Spec>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::api_hub_resource::Resource::Spec(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
    /// to hold a `Spec`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_spec<T: std::convert::Into<std::boxed::Box<crate::model::Spec>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource =
            std::option::Option::Some(crate::model::api_hub_resource::Resource::Spec(v.into()));
        self
    }

    /// The value of [resource][crate::model::ApiHubResource::resource]
    /// if it holds a `Definition`, `None` if the field is not set or
    /// holds a different branch.
    pub fn definition(&self) -> std::option::Option<&std::boxed::Box<crate::model::Definition>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::api_hub_resource::Resource::Definition(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
    /// to hold a `Definition`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_definition<T: std::convert::Into<std::boxed::Box<crate::model::Definition>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource = std::option::Option::Some(
            crate::model::api_hub_resource::Resource::Definition(v.into()),
        );
        self
    }

    /// The value of [resource][crate::model::ApiHubResource::resource]
    /// if it holds a `Version`, `None` if the field is not set or
    /// holds a different branch.
    pub fn version(&self) -> std::option::Option<&std::boxed::Box<crate::model::Version>> {
        #[allow(unreachable_patterns)]
        self.resource.as_ref().and_then(|v| match v {
            crate::model::api_hub_resource::Resource::Version(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [resource][crate::model::ApiHubResource::resource]
    /// to hold a `Version`.
    ///
    /// Note that all the setters affecting `resource` are
    /// mutually exclusive.
    pub fn set_version<T: std::convert::Into<std::boxed::Box<crate::model::Version>>>(
        mut self,
        v: T,
    ) -> Self {
        self.resource =
            std::option::Option::Some(crate::model::api_hub_resource::Resource::Version(v.into()));
        self
    }
}

impl wkt::message::Message for ApiHubResource {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ApiHubResource"
    }
}

/// Defines additional types related to [ApiHubResource].
pub mod api_hub_resource {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Resource {
        /// This represents Api resource in search results. Only name, display_name,
        /// description and owner fields are populated in search results.
        Api(std::boxed::Box<crate::model::Api>),
        /// This represents ApiOperation resource in search results. Only name,
        /// description, spec and details fields are populated in search results.
        Operation(std::boxed::Box<crate::model::ApiOperation>),
        /// This represents Deployment resource in search results. Only name,
        /// display_name, description, deployment_type and api_versions fields are
        /// populated in search results.
        Deployment(std::boxed::Box<crate::model::Deployment>),
        /// This represents Spec resource in search results. Only name,
        /// display_name, description, spec_type and documentation fields are
        /// populated in search results.
        Spec(std::boxed::Box<crate::model::Spec>),
        /// This represents Definition resource in search results.
        /// Only name field is populated in search results.
        Definition(std::boxed::Box<crate::model::Definition>),
        /// This represents Version resource in search results. Only name,
        /// display_name, description, lifecycle, compliance and accreditation fields
        /// are populated in search results.
        Version(std::boxed::Box<crate::model::Version>),
    }
}

/// Represents the search results.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchResult {
    /// This represents the ApiHubResource.
    /// Note: Only selected fields of the resources are populated in response.
    pub resource: std::option::Option<crate::model::ApiHubResource>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchResult {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [resource][crate::model::SearchResult::resource].
    pub fn set_resource<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ApiHubResource>,
    {
        self.resource = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource][crate::model::SearchResult::resource].
    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ApiHubResource>,
    {
        self.resource = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for SearchResult {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SearchResult"
    }
}

/// Response for the
/// [SearchResources][google.cloud.apihub.v1.ApiHub.SearchResources] method.
///
/// [google.cloud.apihub.v1.ApiHub.SearchResources]: crate::client::ApiHub::search_resources
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchResourcesResponse {
    /// List of search results according to the filter and search query specified.
    /// The order of search results represents the ranking.
    pub search_results: std::vec::Vec<crate::model::SearchResult>,

    /// Pass this token in the
    /// [SearchResourcesRequest][google.cloud.apihub.v1.SearchResourcesRequest]
    /// to continue to list results. If all results have been returned, this field
    /// is an empty string or not present in the response.
    ///
    /// [google.cloud.apihub.v1.SearchResourcesRequest]: crate::model::SearchResourcesRequest
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SearchResourcesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [search_results][crate::model::SearchResourcesResponse::search_results].
    pub fn set_search_results<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SearchResult>,
    {
        use std::iter::Iterator;
        self.search_results = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::SearchResourcesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for SearchResourcesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SearchResourcesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for SearchResourcesResponse {
    type PageItem = crate::model::SearchResult;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.search_results
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The
/// [CreateDependency][google.cloud.apihub.v1.ApiHubDependencies.CreateDependency]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubDependencies.CreateDependency]: crate::client::ApiHubDependencies::create_dependency
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDependencyRequest {
    /// Required. The parent resource for the dependency resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the dependency resource, which will become the
    /// final component of the dependency's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   duplicate id is provided by the client.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, and valid characters
    /// are `[a-z][A-Z][0-9]-_`.
    pub dependency_id: std::string::String,

    /// Required. The dependency resource to create.
    pub dependency: std::option::Option<crate::model::Dependency>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateDependencyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateDependencyRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [dependency_id][crate::model::CreateDependencyRequest::dependency_id].
    pub fn set_dependency_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.dependency_id = v.into();
        self
    }

    /// Sets the value of [dependency][crate::model::CreateDependencyRequest::dependency].
    pub fn set_dependency<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Dependency>,
    {
        self.dependency = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dependency][crate::model::CreateDependencyRequest::dependency].
    pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Dependency>,
    {
        self.dependency = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateDependencyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateDependencyRequest"
    }
}

/// The [GetDependency][.ApiHubDependencies.GetDependency]
/// method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDependencyRequest {
    /// Required. The name of the dependency resource to retrieve.
    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDependencyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDependencyRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDependencyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetDependencyRequest"
    }
}

/// The
/// [UpdateDependency][google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubDependencies.UpdateDependency]: crate::client::ApiHubDependencies::update_dependency
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDependencyRequest {
    /// Required. The dependency resource to update.
    ///
    /// The dependency's `name` field is used to identify the dependency to update.
    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
    pub dependency: std::option::Option<crate::model::Dependency>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateDependencyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [dependency][crate::model::UpdateDependencyRequest::dependency].
    pub fn set_dependency<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Dependency>,
    {
        self.dependency = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [dependency][crate::model::UpdateDependencyRequest::dependency].
    pub fn set_or_clear_dependency<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Dependency>,
    {
        self.dependency = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateDependencyRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateDependencyRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateDependencyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateDependencyRequest"
    }
}

/// The
/// [DeleteDependency][google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubDependencies.DeleteDependency]: crate::client::ApiHubDependencies::delete_dependency
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDependencyRequest {
    /// Required. The name of the dependency resource to delete.
    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteDependencyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteDependencyRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteDependencyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteDependencyRequest"
    }
}

/// The
/// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]: crate::client::ApiHubDependencies::list_dependencies
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDependenciesRequest {
    /// Required. The parent which owns this collection of dependency resources.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of Dependencies.
    ///
    /// A filter expression consists of a field name, a comparison operator, and
    /// a value for filtering. The value must be a string. Allowed comparison
    /// operator is `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `Dependency` are eligible for filtering:
    ///
    /// * `consumer.operation_resource_name` - The operation resource name for
    ///   the consumer entity involved in a dependency. Allowed comparison
    ///   operators: `=`.
    /// * `consumer.external_api_resource_name` - The external api resource name
    ///   for the consumer entity involved in a dependency. Allowed comparison
    ///   operators: `=`.
    /// * `supplier.operation_resource_name` - The operation resource name for
    ///   the supplier entity involved in a dependency. Allowed comparison
    ///   operators: `=`.
    /// * `supplier.external_api_resource_name` - The external api resource name
    ///   for the supplier entity involved in a dependency. Allowed comparison
    ///   operators: `=`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are supported. At most
    /// three filter fields are allowed in the filter string and if provided
    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
    ///
    /// For example, `consumer.operation_resource_name =
    /// \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\" OR
    /// supplier.operation_resource_name =
    /// \"projects/p1/locations/global/apis/a1/versions/v1/operations/o1\"` - The
    /// dependencies with either consumer or supplier operation resource name as
    /// _projects/p1/locations/global/apis/a1/versions/v1/operations/o1_.
    pub filter: std::string::String,

    /// Optional. The maximum number of dependency resources to return. The service
    /// may return fewer than this value. If unspecified, at most 50 dependencies
    /// will be returned. The maximum value is 1000; values above 1000 will be
    /// coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListDependencies` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListDependencies` must
    /// match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDependenciesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDependenciesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDependenciesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDependenciesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDependenciesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDependenciesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDependenciesRequest"
    }
}

/// The
/// [ListDependencies][google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHubDependencies.ListDependencies]: crate::client::ApiHubDependencies::list_dependencies
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDependenciesResponse {
    /// The dependency resources present in the API hub.
    pub dependencies: std::vec::Vec<crate::model::Dependency>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDependenciesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [dependencies][crate::model::ListDependenciesResponse::dependencies].
    pub fn set_dependencies<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Dependency>,
    {
        use std::iter::Iterator;
        self.dependencies = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDependenciesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDependenciesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDependenciesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDependenciesResponse {
    type PageItem = crate::model::Dependency;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.dependencies
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The [CreateExternalApi][google.cloud.apihub.v1.ApiHub.CreateExternalApi]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.CreateExternalApi]: crate::client::ApiHub::create_external_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateExternalApiRequest {
    /// Required. The parent resource for the External API resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the External API resource, which will become
    /// the final component of the External API's resource name. This field is
    /// optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another External API resource in the
    ///   API hub.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-500 characters, and valid characters
    /// are /[a-z][A-Z][0-9]-_/.
    pub external_api_id: std::string::String,

    /// Required. The External API resource to create.
    pub external_api: std::option::Option<crate::model::ExternalApi>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateExternalApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateExternalApiRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [external_api_id][crate::model::CreateExternalApiRequest::external_api_id].
    pub fn set_external_api_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.external_api_id = v.into();
        self
    }

    /// Sets the value of [external_api][crate::model::CreateExternalApiRequest::external_api].
    pub fn set_external_api<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ExternalApi>,
    {
        self.external_api = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [external_api][crate::model::CreateExternalApiRequest::external_api].
    pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ExternalApi>,
    {
        self.external_api = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateExternalApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateExternalApiRequest"
    }
}

/// The [GetExternalApi][google.cloud.apihub.v1.ApiHub.GetExternalApi] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHub.GetExternalApi]: crate::client::ApiHub::get_external_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetExternalApiRequest {
    /// Required. The name of the External API resource to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/externalApis/{externalApi}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetExternalApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetExternalApiRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetExternalApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetExternalApiRequest"
    }
}

/// The [UpdateExternalApi][google.cloud.apihub.v1.ApiHub.UpdateExternalApi]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.UpdateExternalApi]: crate::client::ApiHub::update_external_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateExternalApiRequest {
    /// Required. The External API resource to update.
    ///
    /// The External API resource's `name` field is used to identify the External
    /// API resource to update. Format:
    /// `projects/{project}/locations/{location}/externalApis/{externalApi}`
    pub external_api: std::option::Option<crate::model::ExternalApi>,

    /// Required. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateExternalApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [external_api][crate::model::UpdateExternalApiRequest::external_api].
    pub fn set_external_api<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ExternalApi>,
    {
        self.external_api = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [external_api][crate::model::UpdateExternalApiRequest::external_api].
    pub fn set_or_clear_external_api<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ExternalApi>,
    {
        self.external_api = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateExternalApiRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateExternalApiRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateExternalApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateExternalApiRequest"
    }
}

/// The [DeleteExternalApi][google.cloud.apihub.v1.ApiHub.DeleteExternalApi]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.DeleteExternalApi]: crate::client::ApiHub::delete_external_api
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteExternalApiRequest {
    /// Required. The name of the External API resource to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/externalApis/{externalApi}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteExternalApiRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteExternalApiRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteExternalApiRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteExternalApiRequest"
    }
}

/// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHub.ListExternalApis]: crate::client::ApiHub::list_external_apis
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExternalApisRequest {
    /// Required. The parent, which owns this collection of External API resources.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The maximum number of External API resources to return. The
    /// service may return fewer than this value. If unspecified, at most 50
    /// ExternalApis will be returned. The maximum value is 1000; values above 1000
    /// will be coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListExternalApis` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListExternalApis` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListExternalApisRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListExternalApisRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListExternalApisRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListExternalApisRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListExternalApisRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListExternalApisRequest"
    }
}

/// The [ListExternalApis][google.cloud.apihub.v1.ApiHub.ListExternalApis]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHub.ListExternalApis]: crate::client::ApiHub::list_external_apis
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExternalApisResponse {
    /// The External API resources present in the API hub.
    pub external_apis: std::vec::Vec<crate::model::ExternalApi>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListExternalApisResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [external_apis][crate::model::ListExternalApisResponse::external_apis].
    pub fn set_external_apis<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ExternalApi>,
    {
        use std::iter::Iterator;
        self.external_apis = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListExternalApisResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListExternalApisResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListExternalApisResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListExternalApisResponse {
    type PageItem = crate::model::ExternalApi;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.external_apis
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The CollectApiData method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CollectApiDataRequest {
    /// Required. The regional location of the API hub instance and its resources.
    /// Format: `projects/{project}/locations/{location}`
    pub location: std::string::String,

    /// Required. The type of collection. Applies to all entries in
    /// [api_data][google.cloud.apihub.v1.CollectApiDataRequest.api_data].
    ///
    /// [google.cloud.apihub.v1.CollectApiDataRequest.api_data]: crate::model::CollectApiDataRequest::api_data
    pub collection_type: crate::model::CollectionType,

    /// Required. The plugin instance collecting the API data.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
    pub plugin_instance: std::string::String,

    /// Required. The action ID to be used for collecting the API data.
    /// This should map to one of the action IDs specified
    /// in action configs in the plugin.
    pub action_id: std::string::String,

    /// Required. The API data to be collected.
    pub api_data: std::option::Option<crate::model::ApiData>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CollectApiDataRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [location][crate::model::CollectApiDataRequest::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [collection_type][crate::model::CollectApiDataRequest::collection_type].
    pub fn set_collection_type<T: std::convert::Into<crate::model::CollectionType>>(
        mut self,
        v: T,
    ) -> Self {
        self.collection_type = v.into();
        self
    }

    /// Sets the value of [plugin_instance][crate::model::CollectApiDataRequest::plugin_instance].
    pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.plugin_instance = v.into();
        self
    }

    /// Sets the value of [action_id][crate::model::CollectApiDataRequest::action_id].
    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.action_id = v.into();
        self
    }

    /// Sets the value of [api_data][crate::model::CollectApiDataRequest::api_data].
    pub fn set_api_data<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ApiData>,
    {
        self.api_data = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_data][crate::model::CollectApiDataRequest::api_data].
    pub fn set_or_clear_api_data<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ApiData>,
    {
        self.api_data = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CollectApiDataRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CollectApiDataRequest"
    }
}

/// The API data to be collected.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiData {
    /// The data to be collected.
    pub data: std::option::Option<crate::model::api_data::Data>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ApiData {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [data][crate::model::ApiData::data].
    ///
    /// Note that all the setters affecting `data` are mutually
    /// exclusive.
    pub fn set_data<T: std::convert::Into<std::option::Option<crate::model::api_data::Data>>>(
        mut self,
        v: T,
    ) -> Self {
        self.data = v.into();
        self
    }

    /// The value of [data][crate::model::ApiData::data]
    /// if it holds a `ApiMetadataList`, `None` if the field is not set or
    /// holds a different branch.
    pub fn api_metadata_list(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::ApiMetadataList>> {
        #[allow(unreachable_patterns)]
        self.data.as_ref().and_then(|v| match v {
            crate::model::api_data::Data::ApiMetadataList(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [data][crate::model::ApiData::data]
    /// to hold a `ApiMetadataList`.
    ///
    /// Note that all the setters affecting `data` are
    /// mutually exclusive.
    pub fn set_api_metadata_list<
        T: std::convert::Into<std::boxed::Box<crate::model::ApiMetadataList>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.data =
            std::option::Option::Some(crate::model::api_data::Data::ApiMetadataList(v.into()));
        self
    }
}

impl wkt::message::Message for ApiData {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ApiData"
    }
}

/// Defines additional types related to [ApiData].
pub mod api_data {
    #[allow(unused_imports)]
    use super::*;

    /// The data to be collected.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Data {
        /// Optional. The list of API metadata.
        ApiMetadataList(std::boxed::Box<crate::model::ApiMetadataList>),
    }
}

/// The message to hold repeated API metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiMetadataList {
    /// Required. The list of API metadata.
    pub api_metadata: std::vec::Vec<crate::model::APIMetadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ApiMetadataList {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [api_metadata][crate::model::ApiMetadataList::api_metadata].
    pub fn set_api_metadata<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::APIMetadata>,
    {
        use std::iter::Iterator;
        self.api_metadata = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ApiMetadataList {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ApiMetadataList"
    }
}

/// The API metadata.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct APIMetadata {
    /// Required. The API resource to be pushed to Hub's collect layer. The ID of
    /// the API resource will be generated by Hub to ensure uniqueness across all
    /// APIs across systems.
    pub api: std::option::Option<crate::model::Api>,

    /// Optional. The list of versions present in an API resource.
    pub versions: std::vec::Vec<crate::model::VersionMetadata>,

    /// Optional. The unique identifier of the API in the system where it was
    /// originally created.
    pub original_id: std::string::String,

    /// Optional. Timestamp indicating when the API was created at the source.
    pub original_create_time: std::option::Option<wkt::Timestamp>,

    /// Required. Timestamp indicating when the API was last updated at the source.
    pub original_update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl APIMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [api][crate::model::APIMetadata::api].
    pub fn set_api<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Api>,
    {
        self.api = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api][crate::model::APIMetadata::api].
    pub fn set_or_clear_api<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Api>,
    {
        self.api = v.map(|x| x.into());
        self
    }

    /// Sets the value of [versions][crate::model::APIMetadata::versions].
    pub fn set_versions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::VersionMetadata>,
    {
        use std::iter::Iterator;
        self.versions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [original_id][crate::model::APIMetadata::original_id].
    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.original_id = v.into();
        self
    }

    /// Sets the value of [original_create_time][crate::model::APIMetadata::original_create_time].
    pub fn set_original_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_create_time][crate::model::APIMetadata::original_create_time].
    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_update_time][crate::model::APIMetadata::original_update_time].
    pub fn set_original_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_update_time][crate::model::APIMetadata::original_update_time].
    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for APIMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.APIMetadata"
    }
}

/// The metadata associated with a version of the API resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VersionMetadata {
    /// Required. Represents a version of the API resource in API hub. The ID of
    /// the version will be generated by Hub.
    pub version: std::option::Option<crate::model::Version>,

    /// Optional. The specs associated with this version.
    /// Note that an API version can be associated with multiple specs.
    pub specs: std::vec::Vec<crate::model::SpecMetadata>,

    /// Optional. The deployments linked to this API version.
    /// Note: A particular API version could be deployed to multiple deployments
    /// (for dev deployment, UAT deployment, etc.)
    pub deployments: std::vec::Vec<crate::model::DeploymentMetadata>,

    /// Optional. The unique identifier of the version in the system where it was
    /// originally created.
    pub original_id: std::string::String,

    /// Optional. Timestamp indicating when the version was created at the source.
    pub original_create_time: std::option::Option<wkt::Timestamp>,

    /// Required. Timestamp indicating when the version was last updated at the
    /// source.
    pub original_update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl VersionMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [version][crate::model::VersionMetadata::version].
    pub fn set_version<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Version>,
    {
        self.version = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [version][crate::model::VersionMetadata::version].
    pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Version>,
    {
        self.version = v.map(|x| x.into());
        self
    }

    /// Sets the value of [specs][crate::model::VersionMetadata::specs].
    pub fn set_specs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SpecMetadata>,
    {
        use std::iter::Iterator;
        self.specs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [deployments][crate::model::VersionMetadata::deployments].
    pub fn set_deployments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DeploymentMetadata>,
    {
        use std::iter::Iterator;
        self.deployments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [original_id][crate::model::VersionMetadata::original_id].
    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.original_id = v.into();
        self
    }

    /// Sets the value of [original_create_time][crate::model::VersionMetadata::original_create_time].
    pub fn set_original_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_create_time][crate::model::VersionMetadata::original_create_time].
    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_update_time][crate::model::VersionMetadata::original_update_time].
    pub fn set_original_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_update_time][crate::model::VersionMetadata::original_update_time].
    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for VersionMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.VersionMetadata"
    }
}

/// The metadata associated with a spec of the API version.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpecMetadata {
    /// Required. The spec resource to be pushed to Hub's collect layer. The ID of
    /// the spec will be generated by Hub.
    pub spec: std::option::Option<crate::model::Spec>,

    /// Optional. The unique identifier of the spec in the system where it was
    /// originally created.
    pub original_id: std::string::String,

    /// Optional. Timestamp indicating when the spec was created at the source.
    pub original_create_time: std::option::Option<wkt::Timestamp>,

    /// Required. Timestamp indicating when the spec was last updated at the
    /// source.
    pub original_update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SpecMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spec][crate::model::SpecMetadata::spec].
    pub fn set_spec<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spec>,
    {
        self.spec = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spec][crate::model::SpecMetadata::spec].
    pub fn set_or_clear_spec<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spec>,
    {
        self.spec = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_id][crate::model::SpecMetadata::original_id].
    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.original_id = v.into();
        self
    }

    /// Sets the value of [original_create_time][crate::model::SpecMetadata::original_create_time].
    pub fn set_original_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_create_time][crate::model::SpecMetadata::original_create_time].
    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_update_time][crate::model::SpecMetadata::original_update_time].
    pub fn set_original_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_update_time][crate::model::SpecMetadata::original_update_time].
    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for SpecMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SpecMetadata"
    }
}

/// The metadata associated with a deployment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeploymentMetadata {
    /// Required. The deployment resource to be pushed to Hub's collect layer. The
    /// ID of the deployment will be generated by Hub.
    pub deployment: std::option::Option<crate::model::Deployment>,

    /// Optional. The unique identifier of the deployment in the system where it
    /// was originally created.
    pub original_id: std::string::String,

    /// Optional. Timestamp indicating when the deployment was created at the
    /// source.
    pub original_create_time: std::option::Option<wkt::Timestamp>,

    /// Required. Timestamp indicating when the deployment was last updated at the
    /// source.
    pub original_update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeploymentMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [deployment][crate::model::DeploymentMetadata::deployment].
    pub fn set_deployment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Deployment>,
    {
        self.deployment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [deployment][crate::model::DeploymentMetadata::deployment].
    pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Deployment>,
    {
        self.deployment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_id][crate::model::DeploymentMetadata::original_id].
    pub fn set_original_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.original_id = v.into();
        self
    }

    /// Sets the value of [original_create_time][crate::model::DeploymentMetadata::original_create_time].
    pub fn set_original_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_create_time][crate::model::DeploymentMetadata::original_create_time].
    pub fn set_or_clear_original_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_update_time][crate::model::DeploymentMetadata::original_update_time].
    pub fn set_original_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_update_time][crate::model::DeploymentMetadata::original_update_time].
    pub fn set_or_clear_original_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeploymentMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeploymentMetadata"
    }
}

/// The CollectApiData method's response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CollectApiDataResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CollectApiDataResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for CollectApiDataResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CollectApiDataResponse"
    }
}

/// An API resource in the API Hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Api {
    /// Identifier. The name of the API resource in the API Hub.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}`
    pub name: std::string::String,

    /// Required. The display name of the API resource.
    pub display_name: std::string::String,

    /// Optional. The description of the API resource.
    pub description: std::string::String,

    /// Optional. The documentation for the API resource.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Optional. Owner details for the API resource.
    pub owner: std::option::Option<crate::model::Owner>,

    /// Output only. The list of versions present in an API resource.
    /// Note: An API resource can be associated with more than 1 version.
    /// Format is
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub versions: std::vec::Vec<std::string::String>,

    /// Output only. The time at which the API resource was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the API resource was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The target users for the API.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-target-user`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub target_user: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The team owning the API.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-team`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub team: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The business unit owning the API.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-business-unit`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub business_unit: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The maturity level of the API.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-maturity-level`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub maturity_level: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The list of user defined attributes associated with the API
    /// resource. The key is the attribute name. It will be of the format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    /// Optional. The style of the API.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-api-style`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub api_style: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The selected version for an API resource.
    /// This can be used when special handling is needed on client side for
    /// particular version of the API. Format is
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub selected_version: std::string::String,

    /// Optional. The api requirement doc associated with the API resource.
    /// Carinality is 1 for this attribute. This maps to the following system
    /// defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-api-requirements`
    /// attribute. The value of the attribute should be a proper URI, and in case
    /// of Cloud Storage URI, it should point to a Cloud Storage object,
    /// not a directory.
    pub api_requirements: std::option::Option<crate::model::AttributeValues>,

    /// Optional. Fingerprint of the API resource.
    pub fingerprint: std::string::String,

    /// Output only. The list of sources and metadata from the sources of the API
    /// resource.
    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,

    /// Optional. The api functional requirements associated with the API resource.
    /// Carinality is 1 for this attribute.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-api-functional-requirements`
    /// attribute. The value of the attribute should be a proper URI, and in case
    /// of Cloud Storage URI, it should point to a Cloud Storage object,
    /// not a directory.
    pub api_functional_requirements: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The api technical requirements associated with the API resource.
    /// Carinality is 1 for this attribute. This maps to the following system
    /// defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-api-technical-requirements`
    /// attribute. The value of the attribute should be a proper URI, and in case
    /// of Cloud Storage URI, it should point to a Cloud Storage object,
    /// not a directory.
    pub api_technical_requirements: std::option::Option<crate::model::AttributeValues>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Api {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Api::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Api::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Api::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [documentation][crate::model::Api::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::Api::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [owner][crate::model::Api::owner].
    pub fn set_owner<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [owner][crate::model::Api::owner].
    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = v.map(|x| x.into());
        self
    }

    /// Sets the value of [versions][crate::model::Api::versions].
    pub fn set_versions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.versions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::Api::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Api::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Api::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Api::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target_user][crate::model::Api::target_user].
    pub fn set_target_user<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.target_user = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [target_user][crate::model::Api::target_user].
    pub fn set_or_clear_target_user<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.target_user = v.map(|x| x.into());
        self
    }

    /// Sets the value of [team][crate::model::Api::team].
    pub fn set_team<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.team = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [team][crate::model::Api::team].
    pub fn set_or_clear_team<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.team = v.map(|x| x.into());
        self
    }

    /// Sets the value of [business_unit][crate::model::Api::business_unit].
    pub fn set_business_unit<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.business_unit = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [business_unit][crate::model::Api::business_unit].
    pub fn set_or_clear_business_unit<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.business_unit = v.map(|x| x.into());
        self
    }

    /// Sets the value of [maturity_level][crate::model::Api::maturity_level].
    pub fn set_maturity_level<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.maturity_level = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [maturity_level][crate::model::Api::maturity_level].
    pub fn set_or_clear_maturity_level<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.maturity_level = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Api::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [api_style][crate::model::Api::api_style].
    pub fn set_api_style<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_style = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_style][crate::model::Api::api_style].
    pub fn set_or_clear_api_style<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_style = v.map(|x| x.into());
        self
    }

    /// Sets the value of [selected_version][crate::model::Api::selected_version].
    pub fn set_selected_version<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.selected_version = v.into();
        self
    }

    /// Sets the value of [api_requirements][crate::model::Api::api_requirements].
    pub fn set_api_requirements<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_requirements = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_requirements][crate::model::Api::api_requirements].
    pub fn set_or_clear_api_requirements<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_requirements = v.map(|x| x.into());
        self
    }

    /// Sets the value of [fingerprint][crate::model::Api::fingerprint].
    pub fn set_fingerprint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.fingerprint = v.into();
        self
    }

    /// Sets the value of [source_metadata][crate::model::Api::source_metadata].
    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SourceMetadata>,
    {
        use std::iter::Iterator;
        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [api_functional_requirements][crate::model::Api::api_functional_requirements].
    pub fn set_api_functional_requirements<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_functional_requirements = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_functional_requirements][crate::model::Api::api_functional_requirements].
    pub fn set_or_clear_api_functional_requirements<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_functional_requirements = v.map(|x| x.into());
        self
    }

    /// Sets the value of [api_technical_requirements][crate::model::Api::api_technical_requirements].
    pub fn set_api_technical_requirements<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_technical_requirements = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_technical_requirements][crate::model::Api::api_technical_requirements].
    pub fn set_or_clear_api_technical_requirements<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.api_technical_requirements = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Api {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Api"
    }
}

/// Represents a version of the API resource in API hub. This is also referred
/// to as the API version.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Version {
    /// Identifier. The name of the version.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
    pub name: std::string::String,

    /// Required. The display name of the version.
    pub display_name: std::string::String,

    /// Optional. The description of the version.
    pub description: std::string::String,

    /// Optional. The documentation of the version.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Output only. The specs associated with this version.
    /// Note that an API version can be associated with multiple specs.
    /// Format is
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub specs: std::vec::Vec<std::string::String>,

    /// Output only. The operations contained in the API version.
    /// These operations will be added to the version when a new spec is
    /// added or when an existing spec is updated. Format is
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
    pub api_operations: std::vec::Vec<std::string::String>,

    /// Output only. The definitions contained in the API version.
    /// These definitions will be added to the version when a new spec is
    /// added or when an existing spec is updated. Format is
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
    pub definitions: std::vec::Vec<std::string::String>,

    /// Optional. The deployments linked to this API version.
    /// Note: A particular API version could be deployed to multiple deployments
    /// (for dev deployment, UAT deployment, etc)
    /// Format is
    /// `projects/{project}/locations/{location}/deployments/{deployment}`
    pub deployments: std::vec::Vec<std::string::String>,

    /// Output only. The time at which the version was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the version was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The lifecycle of the API version.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-lifecycle`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub lifecycle: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The compliance associated with the API version.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-compliance`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub compliance: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The accreditations associated with the API version.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-accreditation`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub accreditation: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The list of user defined attributes associated with the Version
    /// resource. The key is the attribute name. It will be of the format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    /// Optional. The selected deployment for a Version resource.
    /// This can be used when special handling is needed on client side for a
    /// particular deployment linked to the version.
    /// Format is
    /// `projects/{project}/locations/{location}/deployments/{deployment}`
    pub selected_deployment: std::string::String,

    /// Output only. The list of sources and metadata from the sources of the
    /// version.
    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Version {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Version::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Version::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Version::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [documentation][crate::model::Version::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::Version::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [specs][crate::model::Version::specs].
    pub fn set_specs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.specs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [api_operations][crate::model::Version::api_operations].
    pub fn set_api_operations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.api_operations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [definitions][crate::model::Version::definitions].
    pub fn set_definitions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.definitions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [deployments][crate::model::Version::deployments].
    pub fn set_deployments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.deployments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::Version::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Version::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Version::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Version::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [lifecycle][crate::model::Version::lifecycle].
    pub fn set_lifecycle<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.lifecycle = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [lifecycle][crate::model::Version::lifecycle].
    pub fn set_or_clear_lifecycle<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.lifecycle = v.map(|x| x.into());
        self
    }

    /// Sets the value of [compliance][crate::model::Version::compliance].
    pub fn set_compliance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.compliance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [compliance][crate::model::Version::compliance].
    pub fn set_or_clear_compliance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.compliance = v.map(|x| x.into());
        self
    }

    /// Sets the value of [accreditation][crate::model::Version::accreditation].
    pub fn set_accreditation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.accreditation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [accreditation][crate::model::Version::accreditation].
    pub fn set_or_clear_accreditation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.accreditation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Version::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [selected_deployment][crate::model::Version::selected_deployment].
    pub fn set_selected_deployment<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.selected_deployment = v.into();
        self
    }

    /// Sets the value of [source_metadata][crate::model::Version::source_metadata].
    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SourceMetadata>,
    {
        use std::iter::Iterator;
        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Version {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Version"
    }
}

/// Represents a spec associated with an API version in the API
/// Hub. Note that specs of various types can be uploaded, however
/// parsing of details is supported for OpenAPI spec currently.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Spec {
    /// Identifier. The name of the spec.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub name: std::string::String,

    /// Required. The display name of the spec.
    /// This can contain the file name of the spec.
    pub display_name: std::string::String,

    /// Required. The type of spec.
    /// The value should be one of the allowed values defined for
    /// `projects/{project}/locations/{location}/attributes/system-spec-type`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API.
    ///
    /// Note, this field is mandatory if content is provided.
    pub spec_type: std::option::Option<crate::model::AttributeValues>,

    /// Optional. Input only. The contents of the uploaded spec.
    pub contents: std::option::Option<crate::model::SpecContents>,

    /// Output only. Details parsed from the spec.
    pub details: std::option::Option<crate::model::SpecDetails>,

    /// Optional. The URI of the spec source in case file is uploaded
    /// from an external version control system.
    pub source_uri: std::string::String,

    /// Output only. The time at which the spec was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the spec was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The lint response for the spec.
    pub lint_response: std::option::Option<crate::model::LintResponse>,

    /// Optional. The list of user defined attributes associated with the spec.
    /// The key is the attribute name. It will be of the format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    /// Optional. The documentation of the spec.
    /// For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
    /// spec.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Optional. Input only. Enum specifying the parsing mode for OpenAPI
    /// Specification (OAS) parsing.
    pub parsing_mode: crate::model::spec::ParsingMode,

    /// Output only. The list of sources and metadata from the sources of the spec.
    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Spec {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Spec::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Spec::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [spec_type][crate::model::Spec::spec_type].
    pub fn set_spec_type<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.spec_type = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spec_type][crate::model::Spec::spec_type].
    pub fn set_or_clear_spec_type<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.spec_type = v.map(|x| x.into());
        self
    }

    /// Sets the value of [contents][crate::model::Spec::contents].
    pub fn set_contents<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SpecContents>,
    {
        self.contents = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [contents][crate::model::Spec::contents].
    pub fn set_or_clear_contents<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SpecContents>,
    {
        self.contents = v.map(|x| x.into());
        self
    }

    /// Sets the value of [details][crate::model::Spec::details].
    pub fn set_details<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SpecDetails>,
    {
        self.details = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [details][crate::model::Spec::details].
    pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SpecDetails>,
    {
        self.details = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_uri][crate::model::Spec::source_uri].
    pub fn set_source_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_uri = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Spec::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Spec::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Spec::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Spec::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [lint_response][crate::model::Spec::lint_response].
    pub fn set_lint_response<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LintResponse>,
    {
        self.lint_response = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [lint_response][crate::model::Spec::lint_response].
    pub fn set_or_clear_lint_response<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::LintResponse>,
    {
        self.lint_response = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Spec::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [documentation][crate::model::Spec::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::Spec::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [parsing_mode][crate::model::Spec::parsing_mode].
    pub fn set_parsing_mode<T: std::convert::Into<crate::model::spec::ParsingMode>>(
        mut self,
        v: T,
    ) -> Self {
        self.parsing_mode = v.into();
        self
    }

    /// Sets the value of [source_metadata][crate::model::Spec::source_metadata].
    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SourceMetadata>,
    {
        use std::iter::Iterator;
        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Spec {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Spec"
    }
}

/// Defines additional types related to [Spec].
pub mod spec {
    #[allow(unused_imports)]
    use super::*;

    /// Specifies the parsing mode for API specifications during creation and
    /// update.
    ///
    /// - `RELAXED`: Parsing errors in the specification content do not fail the
    ///   API call.
    /// - `STRICT`: Parsing errors in the specification content result in failure
    ///   of the API call.
    ///   If not specified, defaults to `RELAXED`.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ParsingMode {
        /// Defaults to `RELAXED`.
        Unspecified,
        /// Parsing of the Spec on create and update is relaxed, meaning that
        /// parsing errors the spec contents will not fail the API call.
        Relaxed,
        /// Parsing of the Spec on create and update is strict, meaning that
        /// parsing errors in the spec contents will fail the API call.
        Strict,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ParsingMode::value] or
        /// [ParsingMode::name].
        UnknownValue(parsing_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod parsing_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ParsingMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Relaxed => std::option::Option::Some(1),
                Self::Strict => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("PARSING_MODE_UNSPECIFIED"),
                Self::Relaxed => std::option::Option::Some("RELAXED"),
                Self::Strict => std::option::Option::Some("STRICT"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ParsingMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ParsingMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ParsingMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Relaxed,
                2 => Self::Strict,
                _ => Self::UnknownValue(parsing_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ParsingMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "PARSING_MODE_UNSPECIFIED" => Self::Unspecified,
                "RELAXED" => Self::Relaxed,
                "STRICT" => Self::Strict,
                _ => Self::UnknownValue(parsing_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ParsingMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Relaxed => serializer.serialize_i32(1),
                Self::Strict => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ParsingMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParsingMode>::new(
                ".google.cloud.apihub.v1.Spec.ParsingMode",
            ))
        }
    }
}

/// Details of the deployment where APIs are hosted.
/// A deployment could represent an Apigee proxy, API gateway, other Google Cloud
/// services or non-Google Cloud services as well. A deployment entity is a root
/// level entity in the API hub and exists independent of any API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Deployment {
    /// Identifier. The name of the deployment.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/deployments/{deployment}`
    pub name: std::string::String,

    /// Required. The display name of the deployment.
    pub display_name: std::string::String,

    /// Optional. The description of the deployment.
    pub description: std::string::String,

    /// Optional. The documentation of the deployment.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Required. The type of deployment.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-deployment-type`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub deployment_type: std::option::Option<crate::model::AttributeValues>,

    /// Required. The resource URI identifies the deployment within its gateway.
    /// For Apigee gateways, its recommended to use the format:
    /// organizations/{org}/environments/{env}/apis/{api}.
    /// For ex: if a proxy with name `orders` is deployed in `staging`
    /// environment of `cymbal` organization, the resource URI would be:
    /// `organizations/cymbal/environments/staging/apis/orders`.
    pub resource_uri: std::string::String,

    /// Required. The endpoints at which this deployment resource is listening for
    /// API requests. This could be a list of complete URIs, hostnames or an IP
    /// addresses.
    pub endpoints: std::vec::Vec<std::string::String>,

    /// Output only. The API versions linked to this deployment.
    /// Note: A particular deployment could be linked to multiple different API
    /// versions (of same or different APIs).
    pub api_versions: std::vec::Vec<std::string::String>,

    /// Output only. The time at which the deployment was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the deployment was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The SLO for this deployment.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-slo`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub slo: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The environment mapping to this deployment.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-environment`
    /// attribute.
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    pub environment: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The list of user defined attributes associated with the
    /// deployment resource. The key is the attribute name. It will be of the
    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    /// Output only. The list of sources and metadata from the sources of the
    /// deployment.
    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,

    /// Optional. The uri where users can navigate to for the management of the
    /// deployment. This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-management-url`
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. The value of the attribute should be a valid URL.
    pub management_url: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The uri where additional source specific information for this
    /// deployment can be found. This maps to the following system defined
    /// attribute:
    /// `projects/{project}/locations/{location}/attributes/system-source-uri`
    /// The number of values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. The value of the attribute should be a valid URI, and in case
    /// of Cloud Storage URI, it should point to a Cloud Storage object,
    /// not a directory.
    pub source_uri: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The project to which the deployment belongs.
    /// For GCP gateways, this will refer to the project identifier.
    /// For others like Edge/OPDK, this will refer to the org identifier.
    pub source_project: std::string::String,

    /// Optional. The environment at source for the deployment.
    /// For example: prod, dev, staging, etc.
    pub source_environment: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Deployment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Deployment::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Deployment::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Deployment::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [documentation][crate::model::Deployment::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::Deployment::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [deployment_type][crate::model::Deployment::deployment_type].
    pub fn set_deployment_type<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.deployment_type = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [deployment_type][crate::model::Deployment::deployment_type].
    pub fn set_or_clear_deployment_type<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.deployment_type = v.map(|x| x.into());
        self
    }

    /// Sets the value of [resource_uri][crate::model::Deployment::resource_uri].
    pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.resource_uri = v.into();
        self
    }

    /// Sets the value of [endpoints][crate::model::Deployment::endpoints].
    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.endpoints = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [api_versions][crate::model::Deployment::api_versions].
    pub fn set_api_versions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.api_versions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::Deployment::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Deployment::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Deployment::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Deployment::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [slo][crate::model::Deployment::slo].
    pub fn set_slo<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.slo = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [slo][crate::model::Deployment::slo].
    pub fn set_or_clear_slo<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.slo = v.map(|x| x.into());
        self
    }

    /// Sets the value of [environment][crate::model::Deployment::environment].
    pub fn set_environment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.environment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [environment][crate::model::Deployment::environment].
    pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.environment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Deployment::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [source_metadata][crate::model::Deployment::source_metadata].
    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SourceMetadata>,
    {
        use std::iter::Iterator;
        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [management_url][crate::model::Deployment::management_url].
    pub fn set_management_url<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.management_url = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [management_url][crate::model::Deployment::management_url].
    pub fn set_or_clear_management_url<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.management_url = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_uri][crate::model::Deployment::source_uri].
    pub fn set_source_uri<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.source_uri = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [source_uri][crate::model::Deployment::source_uri].
    pub fn set_or_clear_source_uri<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.source_uri = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_project][crate::model::Deployment::source_project].
    pub fn set_source_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_project = v.into();
        self
    }

    /// Sets the value of [source_environment][crate::model::Deployment::source_environment].
    pub fn set_source_environment<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.source_environment = v.into();
        self
    }
}

impl wkt::message::Message for Deployment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Deployment"
    }
}

/// Represents an operation contained in an API version in the API Hub.
/// An operation is added/updated/deleted in an API version when a new spec is
/// added or an existing spec is updated/deleted in a version.
/// Currently, an operation will be created only corresponding to OpenAPI spec as
/// parsing is supported for OpenAPI spec.
/// Alternatively operations can be managed via create,update and delete APIs,
/// creation of apiOperation can be possible only for version with no parsed
/// operations and update/delete can be possible only for operations created via
/// create API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiOperation {
    /// Identifier. The name of the operation.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
    pub name: std::string::String,

    /// Output only. The name of the spec will be of the format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    /// Note:The name of the spec will be empty if the operation is created via
    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation] API.
    ///
    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
    pub spec: std::string::String,

    /// Optional. Operation details.
    /// Note: Even though this field is optional, it is required for
    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
    /// API and we will fail the request if not provided.
    ///
    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
    pub details: std::option::Option<crate::model::OperationDetails>,

    /// Output only. The time at which the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the operation was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The list of user defined attributes associated with the API
    /// operation resource. The key is the attribute name. It will be of the
    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    /// Output only. The list of sources and metadata from the sources of the API
    /// operation.
    pub source_metadata: std::vec::Vec<crate::model::SourceMetadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ApiOperation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ApiOperation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spec][crate::model::ApiOperation::spec].
    pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spec = v.into();
        self
    }

    /// Sets the value of [details][crate::model::ApiOperation::details].
    pub fn set_details<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::OperationDetails>,
    {
        self.details = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [details][crate::model::ApiOperation::details].
    pub fn set_or_clear_details<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::OperationDetails>,
    {
        self.details = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::ApiOperation::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ApiOperation::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ApiOperation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ApiOperation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::ApiOperation::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [source_metadata][crate::model::ApiOperation::source_metadata].
    pub fn set_source_metadata<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::SourceMetadata>,
    {
        use std::iter::Iterator;
        self.source_metadata = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ApiOperation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ApiOperation"
    }
}

/// Represents a definition for example schema, request, response definitions
/// contained in an API version.
/// A definition is added/updated/deleted in an API version when a new spec is
/// added or an existing spec is updated/deleted in a version. Currently,
/// definition will be created only corresponding to OpenAPI spec as parsing is
/// supported for OpenAPI spec. Also, within OpenAPI spec, only `schema` object
/// is supported.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Definition {
    /// Identifier. The name of the definition.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition}`
    pub name: std::string::String,

    /// Output only. The name of the spec from where the definition was parsed.
    /// Format is
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub spec: std::string::String,

    /// Output only. The type of the definition.
    pub r#type: crate::model::definition::Type,

    /// Output only. The time at which the definition was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the definition was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The list of user defined attributes associated with the
    /// definition resource. The key is the attribute name. It will be of the
    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    pub value: std::option::Option<crate::model::definition::Value>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Definition {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Definition::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spec][crate::model::Definition::spec].
    pub fn set_spec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spec = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::Definition::type].
    pub fn set_type<T: std::convert::Into<crate::model::definition::Type>>(mut self, v: T) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Definition::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Definition::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Definition::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Definition::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Definition::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [value][crate::model::Definition::value].
    ///
    /// Note that all the setters affecting `value` are mutually
    /// exclusive.
    pub fn set_value<
        T: std::convert::Into<std::option::Option<crate::model::definition::Value>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = v.into();
        self
    }

    /// The value of [value][crate::model::Definition::value]
    /// if it holds a `Schema`, `None` if the field is not set or
    /// holds a different branch.
    pub fn schema(&self) -> std::option::Option<&std::boxed::Box<crate::model::Schema>> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::definition::Value::Schema(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::Definition::value]
    /// to hold a `Schema`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_schema<T: std::convert::Into<std::boxed::Box<crate::model::Schema>>>(
        mut self,
        v: T,
    ) -> Self {
        self.value = std::option::Option::Some(crate::model::definition::Value::Schema(v.into()));
        self
    }
}

impl wkt::message::Message for Definition {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Definition"
    }
}

/// Defines additional types related to [Definition].
pub mod definition {
    #[allow(unused_imports)]
    use super::*;

    /// Enumeration of definition types.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Definition type unspecified.
        Unspecified,
        /// Definition type schema.
        Schema,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Schema => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::Schema => std::option::Option::Some("SCHEMA"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Schema,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "SCHEMA" => Self::Schema,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Schema => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.apihub.v1.Definition.Type",
            ))
        }
    }

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Value {
        /// Output only. The value of a schema definition.
        Schema(std::boxed::Box<crate::model::Schema>),
    }
}

/// An attribute in the API Hub.
/// An attribute is a name value pair which can be attached to different
/// resources in the API hub based on the scope of the attribute. Attributes can
/// either be pre-defined by the API Hub or created by users.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Attribute {
    /// Identifier. The name of the attribute in the API Hub.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`
    pub name: std::string::String,

    /// Required. The display name of the attribute.
    pub display_name: std::string::String,

    /// Optional. The description of the attribute.
    pub description: std::string::String,

    /// Output only. The definition type of the attribute.
    pub definition_type: crate::model::attribute::DefinitionType,

    /// Required. The scope of the attribute. It represents the resource in the API
    /// Hub to which the attribute can be linked.
    pub scope: crate::model::attribute::Scope,

    /// Required. The type of the data of the attribute.
    pub data_type: crate::model::attribute::DataType,

    /// Optional. The list of allowed values when the attribute value is of type
    /// enum. This is required when the data_type of the attribute is ENUM. The
    /// maximum number of allowed values of an attribute will be 1000.
    pub allowed_values: std::vec::Vec<crate::model::attribute::AllowedValue>,

    /// Optional. The maximum number of values that the attribute can have when
    /// associated with an API Hub resource. Cardinality 1 would represent a
    /// single-valued attribute. It must not be less than 1 or greater than 20. If
    /// not specified, the cardinality would be set to 1 by default and represent a
    /// single-valued attribute.
    pub cardinality: i32,

    /// Output only. When mandatory is true, the attribute is mandatory for the
    /// resource specified in the scope. Only System defined attributes can be
    /// mandatory.
    pub mandatory: bool,

    /// Output only. The time at which the attribute was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the attribute was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Attribute {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Attribute::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Attribute::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Attribute::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [definition_type][crate::model::Attribute::definition_type].
    pub fn set_definition_type<T: std::convert::Into<crate::model::attribute::DefinitionType>>(
        mut self,
        v: T,
    ) -> Self {
        self.definition_type = v.into();
        self
    }

    /// Sets the value of [scope][crate::model::Attribute::scope].
    pub fn set_scope<T: std::convert::Into<crate::model::attribute::Scope>>(
        mut self,
        v: T,
    ) -> Self {
        self.scope = v.into();
        self
    }

    /// Sets the value of [data_type][crate::model::Attribute::data_type].
    pub fn set_data_type<T: std::convert::Into<crate::model::attribute::DataType>>(
        mut self,
        v: T,
    ) -> Self {
        self.data_type = v.into();
        self
    }

    /// Sets the value of [allowed_values][crate::model::Attribute::allowed_values].
    pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::attribute::AllowedValue>,
    {
        use std::iter::Iterator;
        self.allowed_values = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [cardinality][crate::model::Attribute::cardinality].
    pub fn set_cardinality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.cardinality = v.into();
        self
    }

    /// Sets the value of [mandatory][crate::model::Attribute::mandatory].
    pub fn set_mandatory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.mandatory = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Attribute::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Attribute::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Attribute::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Attribute::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Attribute {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Attribute"
    }
}

/// Defines additional types related to [Attribute].
pub mod attribute {
    #[allow(unused_imports)]
    use super::*;

    /// The value that can be assigned to the attribute when the data type is
    /// enum.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AllowedValue {
        /// Required. The ID of the allowed value.
        ///
        /// * If provided, the same will be used. The service will throw an error if
        ///   the specified id is already used by another allowed value in the same
        ///   attribute resource.
        /// * If not provided, a system generated id derived from the display name
        ///   will be used. In this case, the service will handle conflict resolution
        ///   by adding a system generated suffix in case of duplicates.
        ///
        /// This value should be 4-63 characters, and valid characters
        /// are /[a-z][0-9]-/.
        pub id: std::string::String,

        /// Required. The display name of the allowed value.
        pub display_name: std::string::String,

        /// Optional. The detailed description of the allowed value.
        pub description: std::string::String,

        /// Optional. When set to true, the allowed value cannot be updated or
        /// deleted by the user. It can only be true for System defined attributes.
        pub immutable: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AllowedValue {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [id][crate::model::attribute::AllowedValue::id].
        pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.id = v.into();
            self
        }

        /// Sets the value of [display_name][crate::model::attribute::AllowedValue::display_name].
        pub fn set_display_name<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.display_name = v.into();
            self
        }

        /// Sets the value of [description][crate::model::attribute::AllowedValue::description].
        pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.description = v.into();
            self
        }

        /// Sets the value of [immutable][crate::model::attribute::AllowedValue::immutable].
        pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.immutable = v.into();
            self
        }
    }

    impl wkt::message::Message for AllowedValue {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.Attribute.AllowedValue"
        }
    }

    /// Enumeration of attribute definition types.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum DefinitionType {
        /// Attribute definition type unspecified.
        Unspecified,
        /// The attribute is predefined by the API Hub. Note that only the list of
        /// allowed values can be updated in this case via UpdateAttribute method.
        SystemDefined,
        /// The attribute is defined by the user.
        UserDefined,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [DefinitionType::value] or
        /// [DefinitionType::name].
        UnknownValue(definition_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod definition_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl DefinitionType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::SystemDefined => std::option::Option::Some(1),
                Self::UserDefined => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("DEFINITION_TYPE_UNSPECIFIED"),
                Self::SystemDefined => std::option::Option::Some("SYSTEM_DEFINED"),
                Self::UserDefined => std::option::Option::Some("USER_DEFINED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for DefinitionType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for DefinitionType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for DefinitionType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::SystemDefined,
                2 => Self::UserDefined,
                _ => Self::UnknownValue(definition_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for DefinitionType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "DEFINITION_TYPE_UNSPECIFIED" => Self::Unspecified,
                "SYSTEM_DEFINED" => Self::SystemDefined,
                "USER_DEFINED" => Self::UserDefined,
                _ => Self::UnknownValue(definition_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for DefinitionType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::SystemDefined => serializer.serialize_i32(1),
                Self::UserDefined => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for DefinitionType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DefinitionType>::new(
                ".google.cloud.apihub.v1.Attribute.DefinitionType",
            ))
        }
    }

    /// Enumeration for the scope of the attribute representing the resource in the
    /// API Hub to which the attribute can be linked.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Scope {
        /// Scope Unspecified.
        Unspecified,
        /// Attribute can be linked to an API.
        Api,
        /// Attribute can be linked to an API version.
        Version,
        /// Attribute can be linked to a Spec.
        Spec,
        /// Attribute can be linked to an API Operation.
        ApiOperation,
        /// Attribute can be linked to a Deployment.
        Deployment,
        /// Attribute can be linked to a Dependency.
        Dependency,
        /// Attribute can be linked to a definition.
        Definition,
        /// Attribute can be linked to a ExternalAPI.
        ExternalApi,
        /// Attribute can be linked to a Plugin.
        Plugin,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Scope::value] or
        /// [Scope::name].
        UnknownValue(scope::UnknownValue),
    }

    #[doc(hidden)]
    pub mod scope {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Scope {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Api => std::option::Option::Some(1),
                Self::Version => std::option::Option::Some(2),
                Self::Spec => std::option::Option::Some(3),
                Self::ApiOperation => std::option::Option::Some(4),
                Self::Deployment => std::option::Option::Some(5),
                Self::Dependency => std::option::Option::Some(6),
                Self::Definition => std::option::Option::Some(7),
                Self::ExternalApi => std::option::Option::Some(8),
                Self::Plugin => std::option::Option::Some(9),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
                Self::Api => std::option::Option::Some("API"),
                Self::Version => std::option::Option::Some("VERSION"),
                Self::Spec => std::option::Option::Some("SPEC"),
                Self::ApiOperation => std::option::Option::Some("API_OPERATION"),
                Self::Deployment => std::option::Option::Some("DEPLOYMENT"),
                Self::Dependency => std::option::Option::Some("DEPENDENCY"),
                Self::Definition => std::option::Option::Some("DEFINITION"),
                Self::ExternalApi => std::option::Option::Some("EXTERNAL_API"),
                Self::Plugin => std::option::Option::Some("PLUGIN"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Scope {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Scope {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Scope {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Api,
                2 => Self::Version,
                3 => Self::Spec,
                4 => Self::ApiOperation,
                5 => Self::Deployment,
                6 => Self::Dependency,
                7 => Self::Definition,
                8 => Self::ExternalApi,
                9 => Self::Plugin,
                _ => Self::UnknownValue(scope::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Scope {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "SCOPE_UNSPECIFIED" => Self::Unspecified,
                "API" => Self::Api,
                "VERSION" => Self::Version,
                "SPEC" => Self::Spec,
                "API_OPERATION" => Self::ApiOperation,
                "DEPLOYMENT" => Self::Deployment,
                "DEPENDENCY" => Self::Dependency,
                "DEFINITION" => Self::Definition,
                "EXTERNAL_API" => Self::ExternalApi,
                "PLUGIN" => Self::Plugin,
                _ => Self::UnknownValue(scope::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Scope {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Api => serializer.serialize_i32(1),
                Self::Version => serializer.serialize_i32(2),
                Self::Spec => serializer.serialize_i32(3),
                Self::ApiOperation => serializer.serialize_i32(4),
                Self::Deployment => serializer.serialize_i32(5),
                Self::Dependency => serializer.serialize_i32(6),
                Self::Definition => serializer.serialize_i32(7),
                Self::ExternalApi => serializer.serialize_i32(8),
                Self::Plugin => serializer.serialize_i32(9),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Scope {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
                ".google.cloud.apihub.v1.Attribute.Scope",
            ))
        }
    }

    /// Enumeration of attribute's data type.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum DataType {
        /// Attribute data type unspecified.
        Unspecified,
        /// Attribute's value is of type enum.
        Enum,
        /// Attribute's value is of type json.
        Json,
        /// Attribute's value is of type string.
        String,
        /// Attribute's value is of type uri.
        Uri,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [DataType::value] or
        /// [DataType::name].
        UnknownValue(data_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod data_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl DataType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Enum => std::option::Option::Some(1),
                Self::Json => std::option::Option::Some(2),
                Self::String => std::option::Option::Some(3),
                Self::Uri => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
                Self::Enum => std::option::Option::Some("ENUM"),
                Self::Json => std::option::Option::Some("JSON"),
                Self::String => std::option::Option::Some("STRING"),
                Self::Uri => std::option::Option::Some("URI"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for DataType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for DataType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for DataType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Enum,
                2 => Self::Json,
                3 => Self::String,
                4 => Self::Uri,
                _ => Self::UnknownValue(data_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for DataType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
                "ENUM" => Self::Enum,
                "JSON" => Self::Json,
                "STRING" => Self::String,
                "URI" => Self::Uri,
                _ => Self::UnknownValue(data_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for DataType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Enum => serializer.serialize_i32(1),
                Self::Json => serializer.serialize_i32(2),
                Self::String => serializer.serialize_i32(3),
                Self::Uri => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for DataType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
                ".google.cloud.apihub.v1.Attribute.DataType",
            ))
        }
    }
}

/// The spec contents.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpecContents {
    /// Required. The contents of the spec.
    pub contents: ::bytes::Bytes,

    /// Required. The mime type of the content for example application/json,
    /// application/yaml, application/wsdl etc.
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SpecContents {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [contents][crate::model::SpecContents::contents].
    pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.contents = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::SpecContents::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for SpecContents {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SpecContents"
    }
}

/// SpecDetails contains the details parsed from supported
/// spec types.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpecDetails {
    /// Output only. The description of the spec.
    pub description: std::string::String,

    pub details: std::option::Option<crate::model::spec_details::Details>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SpecDetails {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [description][crate::model::SpecDetails::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [details][crate::model::SpecDetails::details].
    ///
    /// Note that all the setters affecting `details` are mutually
    /// exclusive.
    pub fn set_details<
        T: std::convert::Into<std::option::Option<crate::model::spec_details::Details>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.details = v.into();
        self
    }

    /// The value of [details][crate::model::SpecDetails::details]
    /// if it holds a `OpenApiSpecDetails`, `None` if the field is not set or
    /// holds a different branch.
    pub fn open_api_spec_details(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::OpenApiSpecDetails>> {
        #[allow(unreachable_patterns)]
        self.details.as_ref().and_then(|v| match v {
            crate::model::spec_details::Details::OpenApiSpecDetails(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [details][crate::model::SpecDetails::details]
    /// to hold a `OpenApiSpecDetails`.
    ///
    /// Note that all the setters affecting `details` are
    /// mutually exclusive.
    pub fn set_open_api_spec_details<
        T: std::convert::Into<std::boxed::Box<crate::model::OpenApiSpecDetails>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.details = std::option::Option::Some(
            crate::model::spec_details::Details::OpenApiSpecDetails(v.into()),
        );
        self
    }
}

impl wkt::message::Message for SpecDetails {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SpecDetails"
    }
}

/// Defines additional types related to [SpecDetails].
pub mod spec_details {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Details {
        /// Output only. Additional details apart from `OperationDetails` parsed from
        /// an OpenAPI spec. The OperationDetails parsed from the spec can be
        /// obtained by using
        /// [ListAPIOperations][google.cloud.apihub.v1.ApiHub.ListApiOperations]
        /// method.
        ///
        /// [google.cloud.apihub.v1.ApiHub.ListApiOperations]: crate::client::ApiHub::list_api_operations
        OpenApiSpecDetails(std::boxed::Box<crate::model::OpenApiSpecDetails>),
    }
}

/// OpenApiSpecDetails contains the details parsed from an OpenAPI spec in
/// addition to the fields mentioned in
/// [SpecDetails][google.cloud.apihub.v1.SpecDetails].
///
/// [google.cloud.apihub.v1.SpecDetails]: crate::model::SpecDetails
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenApiSpecDetails {
    /// Output only. The format of the spec.
    pub format: crate::model::open_api_spec_details::Format,

    /// Output only. The version in the spec.
    /// This maps to `info.version` in OpenAPI spec.
    pub version: std::string::String,

    /// Output only. Owner details for the spec.
    /// This maps to `info.contact` in OpenAPI spec.
    pub owner: std::option::Option<crate::model::Owner>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OpenApiSpecDetails {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [format][crate::model::OpenApiSpecDetails::format].
    pub fn set_format<T: std::convert::Into<crate::model::open_api_spec_details::Format>>(
        mut self,
        v: T,
    ) -> Self {
        self.format = v.into();
        self
    }

    /// Sets the value of [version][crate::model::OpenApiSpecDetails::version].
    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.version = v.into();
        self
    }

    /// Sets the value of [owner][crate::model::OpenApiSpecDetails::owner].
    pub fn set_owner<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [owner][crate::model::OpenApiSpecDetails::owner].
    pub fn set_or_clear_owner<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Owner>,
    {
        self.owner = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for OpenApiSpecDetails {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.OpenApiSpecDetails"
    }
}

/// Defines additional types related to [OpenApiSpecDetails].
pub mod open_api_spec_details {
    #[allow(unused_imports)]
    use super::*;

    /// Enumeration of spec formats.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Format {
        /// SpecFile type unspecified.
        Unspecified,
        /// OpenAPI Spec v2.0.
        OpenApiSpec20,
        /// OpenAPI Spec v3.0.
        OpenApiSpec30,
        /// OpenAPI Spec v3.1.
        OpenApiSpec31,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Format::value] or
        /// [Format::name].
        UnknownValue(format::UnknownValue),
    }

    #[doc(hidden)]
    pub mod format {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Format {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::OpenApiSpec20 => std::option::Option::Some(1),
                Self::OpenApiSpec30 => std::option::Option::Some(2),
                Self::OpenApiSpec31 => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
                Self::OpenApiSpec20 => std::option::Option::Some("OPEN_API_SPEC_2_0"),
                Self::OpenApiSpec30 => std::option::Option::Some("OPEN_API_SPEC_3_0"),
                Self::OpenApiSpec31 => std::option::Option::Some("OPEN_API_SPEC_3_1"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Format {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Format {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Format {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::OpenApiSpec20,
                2 => Self::OpenApiSpec30,
                3 => Self::OpenApiSpec31,
                _ => Self::UnknownValue(format::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Format {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "FORMAT_UNSPECIFIED" => Self::Unspecified,
                "OPEN_API_SPEC_2_0" => Self::OpenApiSpec20,
                "OPEN_API_SPEC_3_0" => Self::OpenApiSpec30,
                "OPEN_API_SPEC_3_1" => Self::OpenApiSpec31,
                _ => Self::UnknownValue(format::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Format {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::OpenApiSpec20 => serializer.serialize_i32(1),
                Self::OpenApiSpec30 => serializer.serialize_i32(2),
                Self::OpenApiSpec31 => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Format {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
                ".google.cloud.apihub.v1.OpenApiSpecDetails.Format",
            ))
        }
    }
}

/// The operation details parsed from the spec.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationDetails {
    /// Optional. Description of the operation behavior.
    /// For OpenAPI spec, this will map to `operation.description` in the
    /// spec, in case description is empty, `operation.summary` will be used.
    pub description: std::string::String,

    /// Optional. Additional external documentation for this operation.
    /// For OpenAPI spec, this will map to `operation.documentation` in the spec.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Optional. For OpenAPI spec, this will be set if `operation.deprecated`is
    /// marked as `true` in the spec.
    pub deprecated: bool,

    pub operation: std::option::Option<crate::model::operation_details::Operation>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationDetails {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [description][crate::model::OperationDetails::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [documentation][crate::model::OperationDetails::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::OperationDetails::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [deprecated][crate::model::OperationDetails::deprecated].
    pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.deprecated = v.into();
        self
    }

    /// Sets the value of [operation][crate::model::OperationDetails::operation].
    ///
    /// Note that all the setters affecting `operation` are mutually
    /// exclusive.
    pub fn set_operation<
        T: std::convert::Into<std::option::Option<crate::model::operation_details::Operation>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.operation = v.into();
        self
    }

    /// The value of [operation][crate::model::OperationDetails::operation]
    /// if it holds a `HttpOperation`, `None` if the field is not set or
    /// holds a different branch.
    pub fn http_operation(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::HttpOperation>> {
        #[allow(unreachable_patterns)]
        self.operation.as_ref().and_then(|v| match v {
            crate::model::operation_details::Operation::HttpOperation(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [operation][crate::model::OperationDetails::operation]
    /// to hold a `HttpOperation`.
    ///
    /// Note that all the setters affecting `operation` are
    /// mutually exclusive.
    pub fn set_http_operation<
        T: std::convert::Into<std::boxed::Box<crate::model::HttpOperation>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.operation = std::option::Option::Some(
            crate::model::operation_details::Operation::HttpOperation(v.into()),
        );
        self
    }
}

impl wkt::message::Message for OperationDetails {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.OperationDetails"
    }
}

/// Defines additional types related to [OperationDetails].
pub mod operation_details {
    #[allow(unused_imports)]
    use super::*;

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Operation {
        /// The HTTP Operation.
        HttpOperation(std::boxed::Box<crate::model::HttpOperation>),
    }
}

/// The HTTP Operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HttpOperation {
    /// Optional. The path details for the Operation.
    /// Note: Even though this field is optional, it is required for
    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
    /// API and we will fail the request if not provided.
    ///
    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
    pub path: std::option::Option<crate::model::Path>,

    /// Optional. Operation method
    /// Note: Even though this field is optional, it is required for
    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
    /// API and we will fail the request if not provided.
    ///
    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
    pub method: crate::model::http_operation::Method,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl HttpOperation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [path][crate::model::HttpOperation::path].
    pub fn set_path<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Path>,
    {
        self.path = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [path][crate::model::HttpOperation::path].
    pub fn set_or_clear_path<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Path>,
    {
        self.path = v.map(|x| x.into());
        self
    }

    /// Sets the value of [method][crate::model::HttpOperation::method].
    pub fn set_method<T: std::convert::Into<crate::model::http_operation::Method>>(
        mut self,
        v: T,
    ) -> Self {
        self.method = v.into();
        self
    }
}

impl wkt::message::Message for HttpOperation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.HttpOperation"
    }
}

/// Defines additional types related to [HttpOperation].
pub mod http_operation {
    #[allow(unused_imports)]
    use super::*;

    /// Enumeration of Method types.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Method {
        /// Method unspecified.
        Unspecified,
        /// Get Operation type.
        Get,
        /// Put Operation type.
        Put,
        /// Post Operation type.
        Post,
        /// Delete Operation type.
        Delete,
        /// Options Operation type.
        Options,
        /// Head Operation type.
        Head,
        /// Patch Operation type.
        Patch,
        /// Trace Operation type.
        Trace,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Method::value] or
        /// [Method::name].
        UnknownValue(method::UnknownValue),
    }

    #[doc(hidden)]
    pub mod method {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Method {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Get => std::option::Option::Some(1),
                Self::Put => std::option::Option::Some(2),
                Self::Post => std::option::Option::Some(3),
                Self::Delete => std::option::Option::Some(4),
                Self::Options => std::option::Option::Some(5),
                Self::Head => std::option::Option::Some(6),
                Self::Patch => std::option::Option::Some(7),
                Self::Trace => std::option::Option::Some(8),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("METHOD_UNSPECIFIED"),
                Self::Get => std::option::Option::Some("GET"),
                Self::Put => std::option::Option::Some("PUT"),
                Self::Post => std::option::Option::Some("POST"),
                Self::Delete => std::option::Option::Some("DELETE"),
                Self::Options => std::option::Option::Some("OPTIONS"),
                Self::Head => std::option::Option::Some("HEAD"),
                Self::Patch => std::option::Option::Some("PATCH"),
                Self::Trace => std::option::Option::Some("TRACE"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Method {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Method {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Method {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Get,
                2 => Self::Put,
                3 => Self::Post,
                4 => Self::Delete,
                5 => Self::Options,
                6 => Self::Head,
                7 => Self::Patch,
                8 => Self::Trace,
                _ => Self::UnknownValue(method::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Method {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "METHOD_UNSPECIFIED" => Self::Unspecified,
                "GET" => Self::Get,
                "PUT" => Self::Put,
                "POST" => Self::Post,
                "DELETE" => Self::Delete,
                "OPTIONS" => Self::Options,
                "HEAD" => Self::Head,
                "PATCH" => Self::Patch,
                "TRACE" => Self::Trace,
                _ => Self::UnknownValue(method::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Method {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Get => serializer.serialize_i32(1),
                Self::Put => serializer.serialize_i32(2),
                Self::Post => serializer.serialize_i32(3),
                Self::Delete => serializer.serialize_i32(4),
                Self::Options => serializer.serialize_i32(5),
                Self::Head => serializer.serialize_i32(6),
                Self::Patch => serializer.serialize_i32(7),
                Self::Trace => serializer.serialize_i32(8),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Method {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Method>::new(
                ".google.cloud.apihub.v1.HttpOperation.Method",
            ))
        }
    }
}

/// The path details derived from the spec.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Path {
    /// Optional. Complete path relative to server endpoint.
    /// Note: Even though this field is optional, it is required for
    /// [CreateApiOperation][google.cloud.apihub.v1.ApiHub.CreateApiOperation]
    /// API and we will fail the request if not provided.
    ///
    /// [google.cloud.apihub.v1.ApiHub.CreateApiOperation]: crate::client::ApiHub::create_api_operation
    pub path: std::string::String,

    /// Optional. A short description for the path applicable to all operations.
    pub description: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Path {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [path][crate::model::Path::path].
    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.path = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Path::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }
}

impl wkt::message::Message for Path {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Path"
    }
}

/// The schema details derived from the spec. Currently, this entity is supported
/// for OpenAPI spec only.
/// For OpenAPI spec, this maps to the schema defined in
/// the  `definitions` section for OpenAPI 2.0 version and in
/// `components.schemas` section for OpenAPI 3.0 and 3.1 version.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Schema {
    /// Output only. The display name of the schema.
    /// This will map to the name of the schema in the spec.
    pub display_name: std::string::String,

    /// Output only. The raw value of the schema definition corresponding to the
    /// schema name in the spec.
    pub raw_value: ::bytes::Bytes,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Schema {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [display_name][crate::model::Schema::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [raw_value][crate::model::Schema::raw_value].
    pub fn set_raw_value<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.raw_value = v.into();
        self
    }
}

impl wkt::message::Message for Schema {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Schema"
    }
}

/// Owner details.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Owner {
    /// Optional. The name of the owner.
    pub display_name: std::string::String,

    /// Required. The email of the owner.
    pub email: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Owner {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [display_name][crate::model::Owner::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [email][crate::model::Owner::email].
    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.email = v.into();
        self
    }
}

impl wkt::message::Message for Owner {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Owner"
    }
}

/// Documentation details.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Documentation {
    /// Optional. The uri of the externally hosted documentation.
    pub external_uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Documentation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [external_uri][crate::model::Documentation::external_uri].
    pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.external_uri = v.into();
        self
    }
}

impl wkt::message::Message for Documentation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Documentation"
    }
}

/// The attribute values associated with resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttributeValues {
    /// Output only. The name of the attribute.
    /// Format: projects/{project}/locations/{location}/attributes/{attribute}
    pub attribute: std::string::String,

    /// The attribute values associated with the resource.
    pub value: std::option::Option<crate::model::attribute_values::Value>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AttributeValues {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [attribute][crate::model::AttributeValues::attribute].
    pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.attribute = v.into();
        self
    }

    /// Sets the value of [value][crate::model::AttributeValues::value].
    ///
    /// Note that all the setters affecting `value` are mutually
    /// exclusive.
    pub fn set_value<
        T: std::convert::Into<std::option::Option<crate::model::attribute_values::Value>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = v.into();
        self
    }

    /// The value of [value][crate::model::AttributeValues::value]
    /// if it holds a `EnumValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn enum_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>>
    {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::attribute_values::Value::EnumValues(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::AttributeValues::value]
    /// to hold a `EnumValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_enum_values<
        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value =
            std::option::Option::Some(crate::model::attribute_values::Value::EnumValues(v.into()));
        self
    }

    /// The value of [value][crate::model::AttributeValues::value]
    /// if it holds a `StringValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn string_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
    {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::attribute_values::Value::StringValues(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::AttributeValues::value]
    /// to hold a `StringValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_string_values<
        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = std::option::Option::Some(
            crate::model::attribute_values::Value::StringValues(v.into()),
        );
        self
    }

    /// The value of [value][crate::model::AttributeValues::value]
    /// if it holds a `JsonValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn json_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
    {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::attribute_values::Value::JsonValues(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::AttributeValues::value]
    /// to hold a `JsonValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_json_values<
        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value =
            std::option::Option::Some(crate::model::attribute_values::Value::JsonValues(v.into()));
        self
    }

    /// The value of [value][crate::model::AttributeValues::value]
    /// if it holds a `UriValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn uri_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>
    {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::attribute_values::Value::UriValues(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::AttributeValues::value]
    /// to hold a `UriValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_uri_values<
        T: std::convert::Into<std::boxed::Box<crate::model::attribute_values::StringAttributeValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value =
            std::option::Option::Some(crate::model::attribute_values::Value::UriValues(v.into()));
        self
    }
}

impl wkt::message::Message for AttributeValues {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.AttributeValues"
    }
}

/// Defines additional types related to [AttributeValues].
pub mod attribute_values {
    #[allow(unused_imports)]
    use super::*;

    /// The attribute values of data type enum.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct EnumAttributeValues {
        /// Required. The attribute values in case attribute data type is enum.
        pub values: std::vec::Vec<crate::model::attribute::AllowedValue>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl EnumAttributeValues {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [values][crate::model::attribute_values::EnumAttributeValues::values].
        pub fn set_values<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::attribute::AllowedValue>,
        {
            use std::iter::Iterator;
            self.values = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for EnumAttributeValues {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.AttributeValues.EnumAttributeValues"
        }
    }

    /// The attribute values of data type string or JSON.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct StringAttributeValues {
        /// Required. The attribute values in case attribute data type is string or
        /// JSON.
        pub values: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl StringAttributeValues {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [values][crate::model::attribute_values::StringAttributeValues::values].
        pub fn set_values<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.values = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for StringAttributeValues {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.AttributeValues.StringAttributeValues"
        }
    }

    /// The attribute values associated with the resource.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Value {
        /// The attribute values associated with a resource in case attribute data
        /// type is enum.
        EnumValues(std::boxed::Box<crate::model::attribute_values::EnumAttributeValues>),
        /// The attribute values associated with a resource in case attribute data
        /// type is string.
        StringValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
        /// The attribute values associated with a resource in case attribute data
        /// type is JSON.
        JsonValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
        /// The attribute values associated with a resource in case attribute data
        /// type is URL, URI or IP, like gs://bucket-name/object-name.
        UriValues(std::boxed::Box<crate::model::attribute_values::StringAttributeValues>),
    }
}

/// A dependency resource defined in the API hub describes a dependency directed
/// from a consumer to a supplier entity. A dependency can be defined between two
/// [Operations][google.cloud.apihub.v1.ApiOperation] or between
/// an [Operation][google.cloud.apihub.v1.ApiOperation] and [External
/// API][google.cloud.apihub.v1.ExternalApi].
///
/// [google.cloud.apihub.v1.ApiOperation]: crate::model::ApiOperation
/// [google.cloud.apihub.v1.ExternalApi]: crate::model::ExternalApi
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Dependency {
    /// Identifier. The name of the dependency in the API Hub.
    ///
    /// Format: `projects/{project}/locations/{location}/dependencies/{dependency}`
    pub name: std::string::String,

    /// Required. Immutable. The entity acting as the consumer in the dependency.
    pub consumer: std::option::Option<crate::model::DependencyEntityReference>,

    /// Required. Immutable. The entity acting as the supplier in the dependency.
    pub supplier: std::option::Option<crate::model::DependencyEntityReference>,

    /// Output only. State of the dependency.
    pub state: crate::model::dependency::State,

    /// Optional. Human readable description corresponding of the dependency.
    pub description: std::string::String,

    /// Output only. Discovery mode of the dependency.
    pub discovery_mode: crate::model::dependency::DiscoveryMode,

    /// Output only. Error details of a dependency if the system has detected it
    /// internally.
    pub error_detail: std::option::Option<crate::model::DependencyErrorDetail>,

    /// Output only. The time at which the dependency was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the dependency was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The list of user defined attributes associated with the
    /// dependency resource. The key is the attribute name. It will be of the
    /// format: `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Dependency {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Dependency::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [consumer][crate::model::Dependency::consumer].
    pub fn set_consumer<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DependencyEntityReference>,
    {
        self.consumer = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [consumer][crate::model::Dependency::consumer].
    pub fn set_or_clear_consumer<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DependencyEntityReference>,
    {
        self.consumer = v.map(|x| x.into());
        self
    }

    /// Sets the value of [supplier][crate::model::Dependency::supplier].
    pub fn set_supplier<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DependencyEntityReference>,
    {
        self.supplier = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [supplier][crate::model::Dependency::supplier].
    pub fn set_or_clear_supplier<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DependencyEntityReference>,
    {
        self.supplier = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::Dependency::state].
    pub fn set_state<T: std::convert::Into<crate::model::dependency::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Dependency::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [discovery_mode][crate::model::Dependency::discovery_mode].
    pub fn set_discovery_mode<T: std::convert::Into<crate::model::dependency::DiscoveryMode>>(
        mut self,
        v: T,
    ) -> Self {
        self.discovery_mode = v.into();
        self
    }

    /// Sets the value of [error_detail][crate::model::Dependency::error_detail].
    pub fn set_error_detail<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DependencyErrorDetail>,
    {
        self.error_detail = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error_detail][crate::model::Dependency::error_detail].
    pub fn set_or_clear_error_detail<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DependencyErrorDetail>,
    {
        self.error_detail = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::Dependency::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Dependency::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Dependency::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Dependency::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Dependency::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for Dependency {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Dependency"
    }
}

/// Defines additional types related to [Dependency].
pub mod dependency {
    #[allow(unused_imports)]
    use super::*;

    /// Possible states for a dependency.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified,
        /// Dependency will be in a proposed state when it is newly identified by the
        /// API hub on its own.
        Proposed,
        /// Dependency will be in a validated state when it is validated by the
        /// admin or manually created in the API hub.
        Validated,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Proposed => std::option::Option::Some(1),
                Self::Validated => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Proposed => std::option::Option::Some("PROPOSED"),
                Self::Validated => std::option::Option::Some("VALIDATED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Proposed,
                2 => Self::Validated,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "PROPOSED" => Self::Proposed,
                "VALIDATED" => Self::Validated,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Proposed => serializer.serialize_i32(1),
                Self::Validated => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apihub.v1.Dependency.State",
            ))
        }
    }

    /// Possible modes of discovering the dependency.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum DiscoveryMode {
        /// Default value. This value is unused.
        Unspecified,
        /// Manual mode of discovery when the dependency is defined by the user.
        Manual,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [DiscoveryMode::value] or
        /// [DiscoveryMode::name].
        UnknownValue(discovery_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod discovery_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl DiscoveryMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Manual => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("DISCOVERY_MODE_UNSPECIFIED"),
                Self::Manual => std::option::Option::Some("MANUAL"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for DiscoveryMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for DiscoveryMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for DiscoveryMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Manual,
                _ => Self::UnknownValue(discovery_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for DiscoveryMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "DISCOVERY_MODE_UNSPECIFIED" => Self::Unspecified,
                "MANUAL" => Self::Manual,
                _ => Self::UnknownValue(discovery_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for DiscoveryMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Manual => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for DiscoveryMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryMode>::new(
                ".google.cloud.apihub.v1.Dependency.DiscoveryMode",
            ))
        }
    }
}

/// Reference to an entity participating in a dependency.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DependencyEntityReference {
    /// Output only. Display name of the entity.
    pub display_name: std::string::String,

    /// Required. Unique identifier for the participating entity.
    pub identifier: std::option::Option<crate::model::dependency_entity_reference::Identifier>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DependencyEntityReference {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [display_name][crate::model::DependencyEntityReference::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [identifier][crate::model::DependencyEntityReference::identifier].
    ///
    /// Note that all the setters affecting `identifier` are mutually
    /// exclusive.
    pub fn set_identifier<
        T: std::convert::Into<
                std::option::Option<crate::model::dependency_entity_reference::Identifier>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.identifier = v.into();
        self
    }

    /// The value of [identifier][crate::model::DependencyEntityReference::identifier]
    /// if it holds a `OperationResourceName`, `None` if the field is not set or
    /// holds a different branch.
    pub fn operation_resource_name(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.identifier.as_ref().and_then(|v| match v {
            crate::model::dependency_entity_reference::Identifier::OperationResourceName(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [identifier][crate::model::DependencyEntityReference::identifier]
    /// to hold a `OperationResourceName`.
    ///
    /// Note that all the setters affecting `identifier` are
    /// mutually exclusive.
    pub fn set_operation_resource_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.identifier = std::option::Option::Some(
            crate::model::dependency_entity_reference::Identifier::OperationResourceName(v.into()),
        );
        self
    }

    /// The value of [identifier][crate::model::DependencyEntityReference::identifier]
    /// if it holds a `ExternalApiResourceName`, `None` if the field is not set or
    /// holds a different branch.
    pub fn external_api_resource_name(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.identifier.as_ref().and_then(|v| match v {
            crate::model::dependency_entity_reference::Identifier::ExternalApiResourceName(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [identifier][crate::model::DependencyEntityReference::identifier]
    /// to hold a `ExternalApiResourceName`.
    ///
    /// Note that all the setters affecting `identifier` are
    /// mutually exclusive.
    pub fn set_external_api_resource_name<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.identifier = std::option::Option::Some(
            crate::model::dependency_entity_reference::Identifier::ExternalApiResourceName(
                v.into(),
            ),
        );
        self
    }
}

impl wkt::message::Message for DependencyEntityReference {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DependencyEntityReference"
    }
}

/// Defines additional types related to [DependencyEntityReference].
pub mod dependency_entity_reference {
    #[allow(unused_imports)]
    use super::*;

    /// Required. Unique identifier for the participating entity.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Identifier {
        /// The resource name of an operation in the API Hub.
        ///
        /// Format:
        /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
        OperationResourceName(std::string::String),
        /// The resource name of an external API in the API Hub.
        ///
        /// Format:
        /// `projects/{project}/locations/{location}/externalApis/{external_api}`
        ExternalApiResourceName(std::string::String),
    }
}

/// Details describing error condition of a dependency.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DependencyErrorDetail {
    /// Optional. Error in the dependency.
    pub error: crate::model::dependency_error_detail::Error,

    /// Optional. Timestamp at which the error was found.
    pub error_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DependencyErrorDetail {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [error][crate::model::DependencyErrorDetail::error].
    pub fn set_error<T: std::convert::Into<crate::model::dependency_error_detail::Error>>(
        mut self,
        v: T,
    ) -> Self {
        self.error = v.into();
        self
    }

    /// Sets the value of [error_time][crate::model::DependencyErrorDetail::error_time].
    pub fn set_error_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.error_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [error_time][crate::model::DependencyErrorDetail::error_time].
    pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.error_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DependencyErrorDetail {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DependencyErrorDetail"
    }
}

/// Defines additional types related to [DependencyErrorDetail].
pub mod dependency_error_detail {
    #[allow(unused_imports)]
    use super::*;

    /// Possible values representing an error in the dependency.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Error {
        /// Default value used for no error in the dependency.
        Unspecified,
        /// Supplier entity has been deleted.
        SupplierNotFound,
        /// Supplier entity has been recreated.
        SupplierRecreated,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Error::value] or
        /// [Error::name].
        UnknownValue(error::UnknownValue),
    }

    #[doc(hidden)]
    pub mod error {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Error {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::SupplierNotFound => std::option::Option::Some(1),
                Self::SupplierRecreated => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("ERROR_UNSPECIFIED"),
                Self::SupplierNotFound => std::option::Option::Some("SUPPLIER_NOT_FOUND"),
                Self::SupplierRecreated => std::option::Option::Some("SUPPLIER_RECREATED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Error {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Error {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Error {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::SupplierNotFound,
                2 => Self::SupplierRecreated,
                _ => Self::UnknownValue(error::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Error {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ERROR_UNSPECIFIED" => Self::Unspecified,
                "SUPPLIER_NOT_FOUND" => Self::SupplierNotFound,
                "SUPPLIER_RECREATED" => Self::SupplierRecreated,
                _ => Self::UnknownValue(error::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Error {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::SupplierNotFound => serializer.serialize_i32(1),
                Self::SupplierRecreated => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Error {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Error>::new(
                ".google.cloud.apihub.v1.DependencyErrorDetail.Error",
            ))
        }
    }
}

/// LintResponse contains the response from the linter.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LintResponse {
    /// Optional. Array of issues found in the analyzed document.
    pub issues: std::vec::Vec<crate::model::Issue>,

    /// Optional. Summary of all issue types and counts for each severity level.
    pub summary: std::vec::Vec<crate::model::lint_response::SummaryEntry>,

    /// Required. Lint state represents success or failure for linting.
    pub state: crate::model::LintState,

    /// Required. Name of the linting application.
    pub source: std::string::String,

    /// Required. Name of the linter used.
    pub linter: crate::model::Linter,

    /// Required. Timestamp when the linting response was generated.
    pub create_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LintResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [issues][crate::model::LintResponse::issues].
    pub fn set_issues<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Issue>,
    {
        use std::iter::Iterator;
        self.issues = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [summary][crate::model::LintResponse::summary].
    pub fn set_summary<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::lint_response::SummaryEntry>,
    {
        use std::iter::Iterator;
        self.summary = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [state][crate::model::LintResponse::state].
    pub fn set_state<T: std::convert::Into<crate::model::LintState>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [source][crate::model::LintResponse::source].
    pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source = v.into();
        self
    }

    /// Sets the value of [linter][crate::model::LintResponse::linter].
    pub fn set_linter<T: std::convert::Into<crate::model::Linter>>(mut self, v: T) -> Self {
        self.linter = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::LintResponse::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::LintResponse::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for LintResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.LintResponse"
    }
}

/// Defines additional types related to [LintResponse].
pub mod lint_response {
    #[allow(unused_imports)]
    use super::*;

    /// Count of issues with a given severity.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SummaryEntry {
        /// Required. Severity of the issue.
        pub severity: crate::model::Severity,

        /// Required. Count of issues with the given severity.
        pub count: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SummaryEntry {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [severity][crate::model::lint_response::SummaryEntry::severity].
        pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
            self.severity = v.into();
            self
        }

        /// Sets the value of [count][crate::model::lint_response::SummaryEntry::count].
        pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.count = v.into();
            self
        }
    }

    impl wkt::message::Message for SummaryEntry {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.LintResponse.SummaryEntry"
        }
    }
}

/// Issue contains the details of a single issue found by the linter.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Issue {
    /// Required. Rule code unique to each rule defined in linter.
    pub code: std::string::String,

    /// Required. An array of strings indicating the location in the analyzed
    /// document where the rule was triggered.
    pub path: std::vec::Vec<std::string::String>,

    /// Required. Human-readable message describing the issue found by the linter.
    pub message: std::string::String,

    /// Required. Severity level of the rule violation.
    pub severity: crate::model::Severity,

    /// Required. Object describing where in the file the issue was found.
    pub range: std::option::Option<crate::model::Range>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Issue {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [code][crate::model::Issue::code].
    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.code = v.into();
        self
    }

    /// Sets the value of [path][crate::model::Issue::path].
    pub fn set_path<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.path = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [message][crate::model::Issue::message].
    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.message = v.into();
        self
    }

    /// Sets the value of [severity][crate::model::Issue::severity].
    pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
        self.severity = v.into();
        self
    }

    /// Sets the value of [range][crate::model::Issue::range].
    pub fn set_range<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Range>,
    {
        self.range = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [range][crate::model::Issue::range].
    pub fn set_or_clear_range<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Range>,
    {
        self.range = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Issue {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Issue"
    }
}

/// Object describing where in the file the issue was found.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Range {
    /// Required. Start of the issue.
    pub start: std::option::Option<crate::model::Point>,

    /// Required. End of the issue.
    pub end: std::option::Option<crate::model::Point>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Range {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [start][crate::model::Range::start].
    pub fn set_start<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Point>,
    {
        self.start = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [start][crate::model::Range::start].
    pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Point>,
    {
        self.start = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end][crate::model::Range::end].
    pub fn set_end<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Point>,
    {
        self.end = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end][crate::model::Range::end].
    pub fn set_or_clear_end<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Point>,
    {
        self.end = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Range {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Range"
    }
}

/// Point within the file (line and character).
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Point {
    /// Required. Line number (zero-indexed).
    pub line: i32,

    /// Required. Character position within the line (zero-indexed).
    pub character: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Point {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [line][crate::model::Point::line].
    pub fn set_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.line = v.into();
        self
    }

    /// Sets the value of [character][crate::model::Point::character].
    pub fn set_character<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.character = v.into();
        self
    }
}

impl wkt::message::Message for Point {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Point"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have been cancelled successfully
    /// have [Operation.error][google.longrunning.Operation.error] value with a
    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
    /// `Code.CANCELLED`.
    ///
    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.OperationMetadata"
    }
}

/// An ApiHubInstance represents the instance resources of the API Hub.
/// Currently, only one ApiHub instance is allowed for each project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApiHubInstance {
    /// Identifier. Format:
    /// `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
    pub name: std::string::String,

    /// Output only. Creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Last update timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The current state of the ApiHub instance.
    pub state: crate::model::api_hub_instance::State,

    /// Output only. Extra information about ApiHub instance state. Currently the
    /// message would be populated when state is `FAILED`.
    pub state_message: std::string::String,

    /// Required. Config of the ApiHub instance.
    pub config: std::option::Option<crate::model::api_hub_instance::Config>,

    /// Optional. Instance labels to represent user-provided metadata.
    /// Refer to cloud documentation on labels for more details.
    /// <https://cloud.google.com/compute/docs/labeling-resources>
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. Description of the ApiHub instance.
    pub description: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ApiHubInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ApiHubInstance::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ApiHubInstance::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ApiHubInstance::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ApiHubInstance::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ApiHubInstance::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [state][crate::model::ApiHubInstance::state].
    pub fn set_state<T: std::convert::Into<crate::model::api_hub_instance::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [state_message][crate::model::ApiHubInstance::state_message].
    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.state_message = v.into();
        self
    }

    /// Sets the value of [config][crate::model::ApiHubInstance::config].
    pub fn set_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::api_hub_instance::Config>,
    {
        self.config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [config][crate::model::ApiHubInstance::config].
    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::api_hub_instance::Config>,
    {
        self.config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::ApiHubInstance::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::ApiHubInstance::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }
}

impl wkt::message::Message for ApiHubInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ApiHubInstance"
    }
}

/// Defines additional types related to [ApiHubInstance].
pub mod api_hub_instance {
    #[allow(unused_imports)]
    use super::*;

    /// Available configurations to provision an ApiHub Instance.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Config {
        /// Optional. The Customer Managed Encryption Key (CMEK) used for data
        /// encryption. The CMEK name should follow the format of
        /// `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
        /// where the location must match the instance location.
        /// If the CMEK is not provided, a GMEK will be created for the instance.
        pub cmek_key_name: std::string::String,

        /// Optional. If true, the search will be disabled for the instance. The
        /// default value is false.
        pub disable_search: bool,

        /// Optional. The name of the Vertex AI location where the data store is
        /// stored.
        pub vertex_location: std::string::String,

        /// Optional. Encryption type for the region. If the encryption type is CMEK,
        /// the cmek_key_name must be provided. If no encryption type is provided,
        /// GMEK will be used.
        pub encryption_type: crate::model::api_hub_instance::config::EncryptionType,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Config {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [cmek_key_name][crate::model::api_hub_instance::Config::cmek_key_name].
        pub fn set_cmek_key_name<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.cmek_key_name = v.into();
            self
        }

        /// Sets the value of [disable_search][crate::model::api_hub_instance::Config::disable_search].
        pub fn set_disable_search<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disable_search = v.into();
            self
        }

        /// Sets the value of [vertex_location][crate::model::api_hub_instance::Config::vertex_location].
        pub fn set_vertex_location<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.vertex_location = v.into();
            self
        }

        /// Sets the value of [encryption_type][crate::model::api_hub_instance::Config::encryption_type].
        pub fn set_encryption_type<
            T: std::convert::Into<crate::model::api_hub_instance::config::EncryptionType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.encryption_type = v.into();
            self
        }
    }

    impl wkt::message::Message for Config {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.ApiHubInstance.Config"
        }
    }

    /// Defines additional types related to [Config].
    pub mod config {
        #[allow(unused_imports)]
        use super::*;

        /// Types of data encryption.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum EncryptionType {
            /// Encryption type unspecified.
            Unspecified,
            /// Default encryption using Google managed encryption key.
            Gmek,
            /// Encryption using customer managed encryption key.
            Cmek,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [EncryptionType::value] or
            /// [EncryptionType::name].
            UnknownValue(encryption_type::UnknownValue),
        }

        #[doc(hidden)]
        pub mod encryption_type {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl EncryptionType {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Gmek => std::option::Option::Some(1),
                    Self::Cmek => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
                    Self::Gmek => std::option::Option::Some("GMEK"),
                    Self::Cmek => std::option::Option::Some("CMEK"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for EncryptionType {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for EncryptionType {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for EncryptionType {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Gmek,
                    2 => Self::Cmek,
                    _ => Self::UnknownValue(encryption_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for EncryptionType {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
                    "GMEK" => Self::Gmek,
                    "CMEK" => Self::Cmek,
                    _ => Self::UnknownValue(encryption_type::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for EncryptionType {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Gmek => serializer.serialize_i32(1),
                    Self::Cmek => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for EncryptionType {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
                    ".google.cloud.apihub.v1.ApiHubInstance.Config.EncryptionType",
                ))
            }
        }
    }

    /// State of the ApiHub Instance.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The default value. This value is used if the state is omitted.
        Unspecified,
        /// The ApiHub instance has not been initialized or has been deleted.
        Inactive,
        /// The ApiHub instance is being created.
        Creating,
        /// The ApiHub instance has been created and is ready for use.
        Active,
        /// The ApiHub instance is being updated.
        Updating,
        /// The ApiHub instance is being deleted.
        Deleting,
        /// The ApiHub instance encountered an error during a state change.
        Failed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Inactive => std::option::Option::Some(1),
                Self::Creating => std::option::Option::Some(2),
                Self::Active => std::option::Option::Some(3),
                Self::Updating => std::option::Option::Some(4),
                Self::Deleting => std::option::Option::Some(5),
                Self::Failed => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Inactive => std::option::Option::Some("INACTIVE"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Updating => std::option::Option::Some("UPDATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Inactive,
                2 => Self::Creating,
                3 => Self::Active,
                4 => Self::Updating,
                5 => Self::Deleting,
                6 => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "INACTIVE" => Self::Inactive,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "UPDATING" => Self::Updating,
                "DELETING" => Self::Deleting,
                "FAILED" => Self::Failed,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Inactive => serializer.serialize_i32(1),
                Self::Creating => serializer.serialize_i32(2),
                Self::Active => serializer.serialize_i32(3),
                Self::Updating => serializer.serialize_i32(4),
                Self::Deleting => serializer.serialize_i32(5),
                Self::Failed => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apihub.v1.ApiHubInstance.State",
            ))
        }
    }
}

/// An external API represents an API being provided by external sources. This
/// can be used to model third-party APIs and can be used to define dependencies.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExternalApi {
    /// Identifier. Format:
    /// `projects/{project}/locations/{location}/externalApi/{externalApi}`.
    pub name: std::string::String,

    /// Required. Display name of the external API. Max length is 63 characters
    /// (Unicode Code Points).
    pub display_name: std::string::String,

    /// Optional. Description of the external API. Max length is 2000 characters
    /// (Unicode Code Points).
    pub description: std::string::String,

    /// Optional. List of endpoints on which this API is accessible.
    pub endpoints: std::vec::Vec<std::string::String>,

    /// Optional. List of paths served by this API.
    pub paths: std::vec::Vec<std::string::String>,

    /// Optional. Documentation of the external API.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Optional. The list of user defined attributes associated with the Version
    /// resource. The key is the attribute name. It will be of the format:
    /// `projects/{project}/locations/{location}/attributes/{attribute}`.
    /// The value is the attribute values associated with the resource.
    pub attributes: std::collections::HashMap<std::string::String, crate::model::AttributeValues>,

    /// Output only. Creation timestamp.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Last update timestamp.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExternalApi {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ExternalApi::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::ExternalApi::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::ExternalApi::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [endpoints][crate::model::ExternalApi::endpoints].
    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.endpoints = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [paths][crate::model::ExternalApi::paths].
    pub fn set_paths<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.paths = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [documentation][crate::model::ExternalApi::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::ExternalApi::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::ExternalApi::attributes].
    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::AttributeValues>,
    {
        use std::iter::Iterator;
        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::ExternalApi::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ExternalApi::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ExternalApi::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ExternalApi::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExternalApi {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ExternalApi"
    }
}

/// ConfigValueOption represents an option for a config variable of type enum or
/// multi select.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigValueOption {
    /// Required. Id of the option.
    pub id: std::string::String,

    /// Required. Display name of the option.
    pub display_name: std::string::String,

    /// Optional. Description of the option.
    pub description: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ConfigValueOption {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [id][crate::model::ConfigValueOption::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::ConfigValueOption::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::ConfigValueOption::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }
}

impl wkt::message::Message for ConfigValueOption {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ConfigValueOption"
    }
}

/// Secret provides a reference to entries in Secret Manager.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Secret {
    /// Required. The resource name of the secret version in the format,
    /// format as: `projects/*/secrets/*/versions/*`.
    pub secret_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Secret {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [secret_version][crate::model::Secret::secret_version].
    pub fn set_secret_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.secret_version = v.into();
        self
    }
}

impl wkt::message::Message for Secret {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Secret"
    }
}

/// ConfigVariableTemplate represents a configuration variable template present
/// in a Plugin Config.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigVariableTemplate {
    /// Required. ID of the config variable. Must be unique within the
    /// configuration.
    pub id: std::string::String,

    /// Required. Type of the parameter: string, int, bool etc.
    pub value_type: crate::model::config_variable_template::ValueType,

    /// Optional. Description.
    pub description: std::string::String,

    /// Optional. Regular expression in RE2 syntax used for validating the `value`
    /// of a `ConfigVariable`.
    pub validation_regex: std::string::String,

    /// Optional. Flag represents that this `ConfigVariable` must be provided for a
    /// PluginInstance.
    pub required: bool,

    /// Optional. Enum options. To be populated if `ValueType` is `ENUM`.
    pub enum_options: std::vec::Vec<crate::model::ConfigValueOption>,

    /// Optional. Multi select options. To be populated if `ValueType` is
    /// `MULTI_SELECT`.
    pub multi_select_options: std::vec::Vec<crate::model::ConfigValueOption>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ConfigVariableTemplate {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [id][crate::model::ConfigVariableTemplate::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [value_type][crate::model::ConfigVariableTemplate::value_type].
    pub fn set_value_type<
        T: std::convert::Into<crate::model::config_variable_template::ValueType>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value_type = v.into();
        self
    }

    /// Sets the value of [description][crate::model::ConfigVariableTemplate::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [validation_regex][crate::model::ConfigVariableTemplate::validation_regex].
    pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.validation_regex = v.into();
        self
    }

    /// Sets the value of [required][crate::model::ConfigVariableTemplate::required].
    pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.required = v.into();
        self
    }

    /// Sets the value of [enum_options][crate::model::ConfigVariableTemplate::enum_options].
    pub fn set_enum_options<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ConfigValueOption>,
    {
        use std::iter::Iterator;
        self.enum_options = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [multi_select_options][crate::model::ConfigVariableTemplate::multi_select_options].
    pub fn set_multi_select_options<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ConfigValueOption>,
    {
        use std::iter::Iterator;
        self.multi_select_options = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ConfigVariableTemplate {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ConfigVariableTemplate"
    }
}

/// Defines additional types related to [ConfigVariableTemplate].
pub mod config_variable_template {
    #[allow(unused_imports)]
    use super::*;

    /// ValueType indicates the data type of the value.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ValueType {
        /// Value type is not specified.
        Unspecified,
        /// Value type is string.
        String,
        /// Value type is integer.
        Int,
        /// Value type is boolean.
        Bool,
        /// Value type is secret.
        Secret,
        /// Value type is enum.
        Enum,
        /// Value type is multi select.
        MultiSelect,
        /// Value type is multi string.
        MultiString,
        /// Value type is multi int.
        MultiInt,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ValueType::value] or
        /// [ValueType::name].
        UnknownValue(value_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod value_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ValueType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::String => std::option::Option::Some(1),
                Self::Int => std::option::Option::Some(2),
                Self::Bool => std::option::Option::Some(3),
                Self::Secret => std::option::Option::Some(4),
                Self::Enum => std::option::Option::Some(5),
                Self::MultiSelect => std::option::Option::Some(6),
                Self::MultiString => std::option::Option::Some(7),
                Self::MultiInt => std::option::Option::Some(8),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
                Self::String => std::option::Option::Some("STRING"),
                Self::Int => std::option::Option::Some("INT"),
                Self::Bool => std::option::Option::Some("BOOL"),
                Self::Secret => std::option::Option::Some("SECRET"),
                Self::Enum => std::option::Option::Some("ENUM"),
                Self::MultiSelect => std::option::Option::Some("MULTI_SELECT"),
                Self::MultiString => std::option::Option::Some("MULTI_STRING"),
                Self::MultiInt => std::option::Option::Some("MULTI_INT"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ValueType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ValueType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ValueType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::String,
                2 => Self::Int,
                3 => Self::Bool,
                4 => Self::Secret,
                5 => Self::Enum,
                6 => Self::MultiSelect,
                7 => Self::MultiString,
                8 => Self::MultiInt,
                _ => Self::UnknownValue(value_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ValueType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "STRING" => Self::String,
                "INT" => Self::Int,
                "BOOL" => Self::Bool,
                "SECRET" => Self::Secret,
                "ENUM" => Self::Enum,
                "MULTI_SELECT" => Self::MultiSelect,
                "MULTI_STRING" => Self::MultiString,
                "MULTI_INT" => Self::MultiInt,
                _ => Self::UnknownValue(value_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ValueType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::String => serializer.serialize_i32(1),
                Self::Int => serializer.serialize_i32(2),
                Self::Bool => serializer.serialize_i32(3),
                Self::Secret => serializer.serialize_i32(4),
                Self::Enum => serializer.serialize_i32(5),
                Self::MultiSelect => serializer.serialize_i32(6),
                Self::MultiString => serializer.serialize_i32(7),
                Self::MultiInt => serializer.serialize_i32(8),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ValueType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
                ".google.cloud.apihub.v1.ConfigVariableTemplate.ValueType",
            ))
        }
    }
}

/// ConfigVariable represents a additional configuration variable present in a
/// PluginInstance Config or AuthConfig, based on a ConfigVariableTemplate.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConfigVariable {
    /// Output only. Key will be the
    /// [id][google.cloud.apihub.v1.ConfigVariableTemplate.id] to uniquely identify
    /// the config variable.
    ///
    /// [google.cloud.apihub.v1.ConfigVariableTemplate.id]: crate::model::ConfigVariableTemplate::id
    pub key: std::string::String,

    /// The values associated with the config variable.
    pub value: std::option::Option<crate::model::config_variable::Value>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ConfigVariable {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [key][crate::model::ConfigVariable::key].
    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.key = v.into();
        self
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value].
    ///
    /// Note that all the setters affecting `value` are mutually
    /// exclusive.
    pub fn set_value<
        T: std::convert::Into<std::option::Option<crate::model::config_variable::Value>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = v.into();
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `StringValue`, `None` if the field is not set or
    /// holds a different branch.
    pub fn string_value(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::StringValue(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `StringValue`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.value =
            std::option::Option::Some(crate::model::config_variable::Value::StringValue(v.into()));
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `IntValue`, `None` if the field is not set or
    /// holds a different branch.
    pub fn int_value(&self) -> std::option::Option<&i64> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::IntValue(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `IntValue`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.value =
            std::option::Option::Some(crate::model::config_variable::Value::IntValue(v.into()));
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `BoolValue`, `None` if the field is not set or
    /// holds a different branch.
    pub fn bool_value(&self) -> std::option::Option<&bool> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::BoolValue(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `BoolValue`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.value =
            std::option::Option::Some(crate::model::config_variable::Value::BoolValue(v.into()));
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `SecretValue`, `None` if the field is not set or
    /// holds a different branch.
    pub fn secret_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Secret>> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::SecretValue(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `SecretValue`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_secret_value<T: std::convert::Into<std::boxed::Box<crate::model::Secret>>>(
        mut self,
        v: T,
    ) -> Self {
        self.value =
            std::option::Option::Some(crate::model::config_variable::Value::SecretValue(v.into()));
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `EnumValue`, `None` if the field is not set or
    /// holds a different branch.
    pub fn enum_value(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::ConfigValueOption>> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::EnumValue(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `EnumValue`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_enum_value<
        T: std::convert::Into<std::boxed::Box<crate::model::ConfigValueOption>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value =
            std::option::Option::Some(crate::model::config_variable::Value::EnumValue(v.into()));
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `MultiSelectValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn multi_select_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiSelectValues>>
    {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::MultiSelectValues(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `MultiSelectValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_multi_select_values<
        T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiSelectValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = std::option::Option::Some(
            crate::model::config_variable::Value::MultiSelectValues(v.into()),
        );
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `MultiStringValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn multi_string_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiStringValues>>
    {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::MultiStringValues(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `MultiStringValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_multi_string_values<
        T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiStringValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = std::option::Option::Some(
            crate::model::config_variable::Value::MultiStringValues(v.into()),
        );
        self
    }

    /// The value of [value][crate::model::ConfigVariable::value]
    /// if it holds a `MultiIntValues`, `None` if the field is not set or
    /// holds a different branch.
    pub fn multi_int_values(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::config_variable::MultiIntValues>> {
        #[allow(unreachable_patterns)]
        self.value.as_ref().and_then(|v| match v {
            crate::model::config_variable::Value::MultiIntValues(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [value][crate::model::ConfigVariable::value]
    /// to hold a `MultiIntValues`.
    ///
    /// Note that all the setters affecting `value` are
    /// mutually exclusive.
    pub fn set_multi_int_values<
        T: std::convert::Into<std::boxed::Box<crate::model::config_variable::MultiIntValues>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.value = std::option::Option::Some(
            crate::model::config_variable::Value::MultiIntValues(v.into()),
        );
        self
    }
}

impl wkt::message::Message for ConfigVariable {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable"
    }
}

/// Defines additional types related to [ConfigVariable].
pub mod config_variable {
    #[allow(unused_imports)]
    use super::*;

    /// The config variable value of data type multi select.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MultiSelectValues {
        /// Optional. The config variable value of data type multi select.
        pub values: std::vec::Vec<crate::model::ConfigValueOption>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MultiSelectValues {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [values][crate::model::config_variable::MultiSelectValues::values].
        pub fn set_values<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::ConfigValueOption>,
        {
            use std::iter::Iterator;
            self.values = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for MultiSelectValues {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiSelectValues"
        }
    }

    /// The config variable value of data type multi string.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MultiStringValues {
        /// Optional. The config variable value of data type multi string.
        pub values: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MultiStringValues {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [values][crate::model::config_variable::MultiStringValues::values].
        pub fn set_values<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.values = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for MultiStringValues {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiStringValues"
        }
    }

    /// The config variable value of data type multi int.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MultiIntValues {
        /// Optional. The config variable value of data type multi int.
        pub values: std::vec::Vec<i32>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MultiIntValues {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [values][crate::model::config_variable::MultiIntValues::values].
        pub fn set_values<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<i32>,
        {
            use std::iter::Iterator;
            self.values = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for MultiIntValues {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.ConfigVariable.MultiIntValues"
        }
    }

    /// The values associated with the config variable.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Value {
        /// Optional. The config variable value in case of config variable of type
        /// string.
        StringValue(std::string::String),
        /// Optional. The config variable value in case of config variable of type
        /// integer.
        IntValue(i64),
        /// Optional. The config variable value in case of config variable of type
        /// boolean.
        BoolValue(bool),
        /// Optional. The config variable value in case of config variable of type
        /// secret.
        SecretValue(std::boxed::Box<crate::model::Secret>),
        /// Optional. The config variable value in case of config variable of type
        /// enum.
        EnumValue(std::boxed::Box<crate::model::ConfigValueOption>),
        /// Optional. The config variable value in case of config variable of type
        /// multi select.
        MultiSelectValues(std::boxed::Box<crate::model::config_variable::MultiSelectValues>),
        /// Optional. The config variable value in case of config variable of type
        /// multi string.
        MultiStringValues(std::boxed::Box<crate::model::config_variable::MultiStringValues>),
        /// Optional. The config variable value in case of config variable of type
        /// multi integer.
        MultiIntValues(std::boxed::Box<crate::model::config_variable::MultiIntValues>),
    }
}

/// Config for Google service account authentication.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GoogleServiceAccountConfig {
    /// Required. The service account to be used for authenticating request.
    ///
    /// The `iam.serviceAccounts.getAccessToken` permission should be granted on
    /// this service account to the impersonator service account.
    pub service_account: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GoogleServiceAccountConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_account][crate::model::GoogleServiceAccountConfig::service_account].
    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_account = v.into();
        self
    }
}

impl wkt::message::Message for GoogleServiceAccountConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GoogleServiceAccountConfig"
    }
}

/// AuthConfig represents the authentication information.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuthConfig {
    /// Required. The authentication type.
    pub auth_type: crate::model::AuthType,

    /// Supported auth types.
    pub config: std::option::Option<crate::model::auth_config::Config>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AuthConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [auth_type][crate::model::AuthConfig::auth_type].
    pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
        self.auth_type = v.into();
        self
    }

    /// Sets the value of [config][crate::model::AuthConfig::config].
    ///
    /// Note that all the setters affecting `config` are mutually
    /// exclusive.
    pub fn set_config<
        T: std::convert::Into<std::option::Option<crate::model::auth_config::Config>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.config = v.into();
        self
    }

    /// The value of [config][crate::model::AuthConfig::config]
    /// if it holds a `GoogleServiceAccountConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn google_service_account_config(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleServiceAccountConfig>> {
        #[allow(unreachable_patterns)]
        self.config.as_ref().and_then(|v| match v {
            crate::model::auth_config::Config::GoogleServiceAccountConfig(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [config][crate::model::AuthConfig::config]
    /// to hold a `GoogleServiceAccountConfig`.
    ///
    /// Note that all the setters affecting `config` are
    /// mutually exclusive.
    pub fn set_google_service_account_config<
        T: std::convert::Into<std::boxed::Box<crate::model::GoogleServiceAccountConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.config = std::option::Option::Some(
            crate::model::auth_config::Config::GoogleServiceAccountConfig(v.into()),
        );
        self
    }

    /// The value of [config][crate::model::AuthConfig::config]
    /// if it holds a `UserPasswordConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn user_password_config(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::UserPasswordConfig>> {
        #[allow(unreachable_patterns)]
        self.config.as_ref().and_then(|v| match v {
            crate::model::auth_config::Config::UserPasswordConfig(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [config][crate::model::AuthConfig::config]
    /// to hold a `UserPasswordConfig`.
    ///
    /// Note that all the setters affecting `config` are
    /// mutually exclusive.
    pub fn set_user_password_config<
        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::UserPasswordConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.config = std::option::Option::Some(
            crate::model::auth_config::Config::UserPasswordConfig(v.into()),
        );
        self
    }

    /// The value of [config][crate::model::AuthConfig::config]
    /// if it holds a `ApiKeyConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn api_key_config(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::ApiKeyConfig>> {
        #[allow(unreachable_patterns)]
        self.config.as_ref().and_then(|v| match v {
            crate::model::auth_config::Config::ApiKeyConfig(v) => std::option::Option::Some(v),
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [config][crate::model::AuthConfig::config]
    /// to hold a `ApiKeyConfig`.
    ///
    /// Note that all the setters affecting `config` are
    /// mutually exclusive.
    pub fn set_api_key_config<
        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::ApiKeyConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.config =
            std::option::Option::Some(crate::model::auth_config::Config::ApiKeyConfig(v.into()));
        self
    }

    /// The value of [config][crate::model::AuthConfig::config]
    /// if it holds a `Oauth2ClientCredentialsConfig`, `None` if the field is not set or
    /// holds a different branch.
    pub fn oauth2_client_credentials_config(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
    > {
        #[allow(unreachable_patterns)]
        self.config.as_ref().and_then(|v| match v {
            crate::model::auth_config::Config::Oauth2ClientCredentialsConfig(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [config][crate::model::AuthConfig::config]
    /// to hold a `Oauth2ClientCredentialsConfig`.
    ///
    /// Note that all the setters affecting `config` are
    /// mutually exclusive.
    pub fn set_oauth2_client_credentials_config<
        T: std::convert::Into<
                std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.config = std::option::Option::Some(
            crate::model::auth_config::Config::Oauth2ClientCredentialsConfig(v.into()),
        );
        self
    }
}

impl wkt::message::Message for AuthConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.AuthConfig"
    }
}

/// Defines additional types related to [AuthConfig].
pub mod auth_config {
    #[allow(unused_imports)]
    use super::*;

    /// Parameters to support Username and Password Authentication.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct UserPasswordConfig {
        /// Required. Username.
        pub username: std::string::String,

        /// Required. Secret version reference containing the password.
        /// The `secretmanager.versions.access` permission should be
        /// granted to the service account accessing the secret.
        pub password: std::option::Option<crate::model::Secret>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl UserPasswordConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [username][crate::model::auth_config::UserPasswordConfig::username].
        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.username = v.into();
            self
        }

        /// Sets the value of [password][crate::model::auth_config::UserPasswordConfig::password].
        pub fn set_password<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.password = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [password][crate::model::auth_config::UserPasswordConfig::password].
        pub fn set_or_clear_password<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.password = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for UserPasswordConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.UserPasswordConfig"
        }
    }

    /// Parameters to support Oauth 2.0 client credentials grant authentication.
    /// See <https://tools.ietf.org/html/rfc6749#section-1.3.4> for more details.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Oauth2ClientCredentialsConfig {
        /// Required. The client identifier.
        pub client_id: std::string::String,

        /// Required. Secret version reference containing the client secret.
        /// The `secretmanager.versions.access` permission should be
        /// granted to the service account accessing the secret.
        pub client_secret: std::option::Option<crate::model::Secret>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Oauth2ClientCredentialsConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [client_id][crate::model::auth_config::Oauth2ClientCredentialsConfig::client_id].
        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.client_id = v.into();
            self
        }

        /// Sets the value of [client_secret][crate::model::auth_config::Oauth2ClientCredentialsConfig::client_secret].
        pub fn set_client_secret<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.client_secret = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [client_secret][crate::model::auth_config::Oauth2ClientCredentialsConfig::client_secret].
        pub fn set_or_clear_client_secret<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.client_secret = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for Oauth2ClientCredentialsConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.Oauth2ClientCredentialsConfig"
        }
    }

    /// Config for authentication with API key.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ApiKeyConfig {
        /// Required. The parameter name of the API key.
        /// E.g. If the API request is "<https://example.com/act?api_key=>\<API KEY\>",
        /// "api_key" would be the parameter name.
        pub name: std::string::String,

        /// Required. The name of the SecretManager secret version resource storing
        /// the API key. Format:
        /// `projects/{project}/secrets/{secrete}/versions/{version}`. The
        /// `secretmanager.versions.access` permission should be granted to the
        /// service account accessing the secret.
        pub api_key: std::option::Option<crate::model::Secret>,

        /// Required. The location of the API key.
        /// The default value is QUERY.
        pub http_element_location: crate::model::auth_config::api_key_config::HttpElementLocation,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ApiKeyConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::auth_config::ApiKeyConfig::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [api_key][crate::model::auth_config::ApiKeyConfig::api_key].
        pub fn set_api_key<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.api_key = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [api_key][crate::model::auth_config::ApiKeyConfig::api_key].
        pub fn set_or_clear_api_key<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.api_key = v.map(|x| x.into());
            self
        }

        /// Sets the value of [http_element_location][crate::model::auth_config::ApiKeyConfig::http_element_location].
        pub fn set_http_element_location<
            T: std::convert::Into<crate::model::auth_config::api_key_config::HttpElementLocation>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.http_element_location = v.into();
            self
        }
    }

    impl wkt::message::Message for ApiKeyConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.AuthConfig.ApiKeyConfig"
        }
    }

    /// Defines additional types related to [ApiKeyConfig].
    pub mod api_key_config {
        #[allow(unused_imports)]
        use super::*;

        /// Enum of location an HTTP element can be.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum HttpElementLocation {
            /// HTTP element location not specified.
            Unspecified,
            /// Element is in the HTTP request query.
            Query,
            /// Element is in the HTTP request header.
            Header,
            /// Element is in the HTTP request path.
            Path,
            /// Element is in the HTTP request body.
            Body,
            /// Element is in the HTTP request cookie.
            Cookie,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [HttpElementLocation::value] or
            /// [HttpElementLocation::name].
            UnknownValue(http_element_location::UnknownValue),
        }

        #[doc(hidden)]
        pub mod http_element_location {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl HttpElementLocation {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Query => std::option::Option::Some(1),
                    Self::Header => std::option::Option::Some(2),
                    Self::Path => std::option::Option::Some(3),
                    Self::Body => std::option::Option::Some(4),
                    Self::Cookie => std::option::Option::Some(5),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => {
                        std::option::Option::Some("HTTP_ELEMENT_LOCATION_UNSPECIFIED")
                    }
                    Self::Query => std::option::Option::Some("QUERY"),
                    Self::Header => std::option::Option::Some("HEADER"),
                    Self::Path => std::option::Option::Some("PATH"),
                    Self::Body => std::option::Option::Some("BODY"),
                    Self::Cookie => std::option::Option::Some("COOKIE"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for HttpElementLocation {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for HttpElementLocation {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for HttpElementLocation {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Query,
                    2 => Self::Header,
                    3 => Self::Path,
                    4 => Self::Body,
                    5 => Self::Cookie,
                    _ => Self::UnknownValue(http_element_location::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for HttpElementLocation {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "HTTP_ELEMENT_LOCATION_UNSPECIFIED" => Self::Unspecified,
                    "QUERY" => Self::Query,
                    "HEADER" => Self::Header,
                    "PATH" => Self::Path,
                    "BODY" => Self::Body,
                    "COOKIE" => Self::Cookie,
                    _ => Self::UnknownValue(http_element_location::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for HttpElementLocation {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Query => serializer.serialize_i32(1),
                    Self::Header => serializer.serialize_i32(2),
                    Self::Path => serializer.serialize_i32(3),
                    Self::Body => serializer.serialize_i32(4),
                    Self::Cookie => serializer.serialize_i32(5),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for HttpElementLocation {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(
                    wkt::internal::EnumVisitor::<HttpElementLocation>::new(
                        ".google.cloud.apihub.v1.AuthConfig.ApiKeyConfig.HttpElementLocation",
                    ),
                )
            }
        }
    }

    /// Supported auth types.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Config {
        /// Google Service Account.
        GoogleServiceAccountConfig(std::boxed::Box<crate::model::GoogleServiceAccountConfig>),
        /// User Password.
        UserPasswordConfig(std::boxed::Box<crate::model::auth_config::UserPasswordConfig>),
        /// Api Key Config.
        ApiKeyConfig(std::boxed::Box<crate::model::auth_config::ApiKeyConfig>),
        /// Oauth2.0 Client Credentials.
        Oauth2ClientCredentialsConfig(
            std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentialsConfig>,
        ),
    }
}

/// SourceMetadata represents the metadata for a resource at the source.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SourceMetadata {
    /// Output only. The type of the source.
    pub source_type: crate::model::source_metadata::SourceType,

    /// Output only. The unique identifier of the resource at the source.
    pub original_resource_id: std::string::String,

    /// Output only. The time at which the resource was created at the source.
    pub original_resource_create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the resource was last updated at the source.
    pub original_resource_update_time: std::option::Option<wkt::Timestamp>,

    /// The source of the resource.
    pub source: std::option::Option<crate::model::source_metadata::Source>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SourceMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [source_type][crate::model::SourceMetadata::source_type].
    pub fn set_source_type<T: std::convert::Into<crate::model::source_metadata::SourceType>>(
        mut self,
        v: T,
    ) -> Self {
        self.source_type = v.into();
        self
    }

    /// Sets the value of [original_resource_id][crate::model::SourceMetadata::original_resource_id].
    pub fn set_original_resource_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.original_resource_id = v.into();
        self
    }

    /// Sets the value of [original_resource_create_time][crate::model::SourceMetadata::original_resource_create_time].
    pub fn set_original_resource_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_resource_create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_resource_create_time][crate::model::SourceMetadata::original_resource_create_time].
    pub fn set_or_clear_original_resource_create_time<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_resource_create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [original_resource_update_time][crate::model::SourceMetadata::original_resource_update_time].
    pub fn set_original_resource_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_resource_update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [original_resource_update_time][crate::model::SourceMetadata::original_resource_update_time].
    pub fn set_or_clear_original_resource_update_time<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.original_resource_update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source][crate::model::SourceMetadata::source].
    ///
    /// Note that all the setters affecting `source` are mutually
    /// exclusive.
    pub fn set_source<
        T: std::convert::Into<std::option::Option<crate::model::source_metadata::Source>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.source = v.into();
        self
    }

    /// The value of [source][crate::model::SourceMetadata::source]
    /// if it holds a `PluginInstanceActionSource`, `None` if the field is not set or
    /// holds a different branch.
    pub fn plugin_instance_action_source(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
    > {
        #[allow(unreachable_patterns)]
        self.source.as_ref().and_then(|v| match v {
            crate::model::source_metadata::Source::PluginInstanceActionSource(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [source][crate::model::SourceMetadata::source]
    /// to hold a `PluginInstanceActionSource`.
    ///
    /// Note that all the setters affecting `source` are
    /// mutually exclusive.
    pub fn set_plugin_instance_action_source<
        T: std::convert::Into<
                std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.source = std::option::Option::Some(
            crate::model::source_metadata::Source::PluginInstanceActionSource(v.into()),
        );
        self
    }
}

impl wkt::message::Message for SourceMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.SourceMetadata"
    }
}

/// Defines additional types related to [SourceMetadata].
pub mod source_metadata {
    #[allow(unused_imports)]
    use super::*;

    /// PluginInstanceActionSource represents the plugin instance action source.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PluginInstanceActionSource {
        /// Output only. The resource name of the source plugin instance.
        /// Format is
        /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
        pub plugin_instance: std::string::String,

        /// Output only. The id of the plugin instance action.
        pub action_id: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PluginInstanceActionSource {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [plugin_instance][crate::model::source_metadata::PluginInstanceActionSource::plugin_instance].
        pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.plugin_instance = v.into();
            self
        }

        /// Sets the value of [action_id][crate::model::source_metadata::PluginInstanceActionSource::action_id].
        pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.action_id = v.into();
            self
        }
    }

    impl wkt::message::Message for PluginInstanceActionSource {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.SourceMetadata.PluginInstanceActionSource"
        }
    }

    /// The possible types of the source.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum SourceType {
        /// Source type not specified.
        Unspecified,
        /// Source type plugin.
        Plugin,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [SourceType::value] or
        /// [SourceType::name].
        UnknownValue(source_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod source_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl SourceType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Plugin => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
                Self::Plugin => std::option::Option::Some("PLUGIN"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for SourceType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for SourceType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for SourceType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Plugin,
                _ => Self::UnknownValue(source_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for SourceType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "PLUGIN" => Self::Plugin,
                _ => Self::UnknownValue(source_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for SourceType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Plugin => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for SourceType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
                ".google.cloud.apihub.v1.SourceMetadata.SourceType",
            ))
        }
    }

    /// The source of the resource.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Source {
        /// Output only. The source of the resource is a plugin instance action.
        PluginInstanceActionSource(
            std::boxed::Box<crate::model::source_metadata::PluginInstanceActionSource>,
        ),
    }
}

/// Respresents an API Observation observed in one of the sources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoveredApiObservation {
    /// Identifier. The name of the discovered API Observation.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}`
    pub name: std::string::String,

    /// Optional. Style of ApiObservation
    pub style: crate::model::discovered_api_observation::Style,

    /// Optional. The IP address (IPv4 or IPv6) of the origin server that the
    /// request was sent to. This field can include port information. Examples:
    /// `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`.
    pub server_ips: std::vec::Vec<std::string::String>,

    /// Optional. The hostname of requests processed for this Observation.
    pub hostname: std::string::String,

    /// Optional. Last event detected time stamp
    pub last_event_detected_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The location of the observation source.
    pub source_locations: std::vec::Vec<std::string::String>,

    /// Optional. The number of observed API Operations.
    pub api_operation_count: i64,

    /// Optional. For an observation pushed from a gcp resource, this would be the
    /// gcp project id.
    pub origin: std::string::String,

    /// Optional. The type of the source from which the observation was collected.
    pub source_types: std::vec::Vec<crate::model::discovered_api_observation::SourceType>,

    /// Output only. The number of known API Operations.
    pub known_operations_count: i64,

    /// Output only. The number of unknown API Operations.
    pub unknown_operations_count: i64,

    /// Output only. Create time stamp of the observation in API Hub.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time stamp of the observation in API Hub.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The metadata of the source from which the observation was
    /// collected.
    pub source_metadata: std::option::Option<crate::model::SourceMetadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiscoveredApiObservation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiscoveredApiObservation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [style][crate::model::DiscoveredApiObservation::style].
    pub fn set_style<T: std::convert::Into<crate::model::discovered_api_observation::Style>>(
        mut self,
        v: T,
    ) -> Self {
        self.style = v.into();
        self
    }

    /// Sets the value of [server_ips][crate::model::DiscoveredApiObservation::server_ips].
    pub fn set_server_ips<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.server_ips = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [hostname][crate::model::DiscoveredApiObservation::hostname].
    pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.hostname = v.into();
        self
    }

    /// Sets the value of [last_event_detected_time][crate::model::DiscoveredApiObservation::last_event_detected_time].
    pub fn set_last_event_detected_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_event_detected_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [last_event_detected_time][crate::model::DiscoveredApiObservation::last_event_detected_time].
    pub fn set_or_clear_last_event_detected_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_event_detected_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_locations][crate::model::DiscoveredApiObservation::source_locations].
    pub fn set_source_locations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.source_locations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [api_operation_count][crate::model::DiscoveredApiObservation::api_operation_count].
    pub fn set_api_operation_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.api_operation_count = v.into();
        self
    }

    /// Sets the value of [origin][crate::model::DiscoveredApiObservation::origin].
    pub fn set_origin<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.origin = v.into();
        self
    }

    /// Sets the value of [source_types][crate::model::DiscoveredApiObservation::source_types].
    pub fn set_source_types<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::discovered_api_observation::SourceType>,
    {
        use std::iter::Iterator;
        self.source_types = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [known_operations_count][crate::model::DiscoveredApiObservation::known_operations_count].
    pub fn set_known_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.known_operations_count = v.into();
        self
    }

    /// Sets the value of [unknown_operations_count][crate::model::DiscoveredApiObservation::unknown_operations_count].
    pub fn set_unknown_operations_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.unknown_operations_count = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::DiscoveredApiObservation::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::DiscoveredApiObservation::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::DiscoveredApiObservation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::DiscoveredApiObservation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_metadata][crate::model::DiscoveredApiObservation::source_metadata].
    pub fn set_source_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SourceMetadata>,
    {
        self.source_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [source_metadata][crate::model::DiscoveredApiObservation::source_metadata].
    pub fn set_or_clear_source_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SourceMetadata>,
    {
        self.source_metadata = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DiscoveredApiObservation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiObservation"
    }
}

/// Defines additional types related to [DiscoveredApiObservation].
pub mod discovered_api_observation {
    #[allow(unused_imports)]
    use super::*;

    /// DiscoveredApiObservation protocol style
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Style {
        /// Unknown style
        Unspecified,
        /// Style is Rest API
        Rest,
        /// Style is Grpc API
        Grpc,
        /// Style is GraphQL API
        Graphql,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Style::value] or
        /// [Style::name].
        UnknownValue(style::UnknownValue),
    }

    #[doc(hidden)]
    pub mod style {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Style {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Rest => std::option::Option::Some(1),
                Self::Grpc => std::option::Option::Some(2),
                Self::Graphql => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STYLE_UNSPECIFIED"),
                Self::Rest => std::option::Option::Some("REST"),
                Self::Grpc => std::option::Option::Some("GRPC"),
                Self::Graphql => std::option::Option::Some("GRAPHQL"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Style {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Style {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Style {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Rest,
                2 => Self::Grpc,
                3 => Self::Graphql,
                _ => Self::UnknownValue(style::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Style {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STYLE_UNSPECIFIED" => Self::Unspecified,
                "REST" => Self::Rest,
                "GRPC" => Self::Grpc,
                "GRAPHQL" => Self::Graphql,
                _ => Self::UnknownValue(style::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Style {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Rest => serializer.serialize_i32(1),
                Self::Grpc => serializer.serialize_i32(2),
                Self::Graphql => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Style {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Style>::new(
                ".google.cloud.apihub.v1.DiscoveredApiObservation.Style",
            ))
        }
    }

    /// The possible types of the source from which the observation was collected.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum SourceType {
        /// Source type not specified.
        Unspecified,
        /// GCP external load balancer.
        GcpXlb,
        /// GCP internal load balancer.
        GcpIlb,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [SourceType::value] or
        /// [SourceType::name].
        UnknownValue(source_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod source_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl SourceType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::GcpXlb => std::option::Option::Some(1),
                Self::GcpIlb => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
                Self::GcpXlb => std::option::Option::Some("GCP_XLB"),
                Self::GcpIlb => std::option::Option::Some("GCP_ILB"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for SourceType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for SourceType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for SourceType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::GcpXlb,
                2 => Self::GcpIlb,
                _ => Self::UnknownValue(source_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for SourceType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
                "GCP_XLB" => Self::GcpXlb,
                "GCP_ILB" => Self::GcpIlb,
                _ => Self::UnknownValue(source_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for SourceType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::GcpXlb => serializer.serialize_i32(1),
                Self::GcpIlb => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for SourceType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
                ".google.cloud.apihub.v1.DiscoveredApiObservation.SourceType",
            ))
        }
    }
}

/// DiscoveredApiOperation represents an API Operation observed in one of the
/// sources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoveredApiOperation {
    /// Identifier. The name of the discovered API Operation.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}/discoveredApiOperations/{discovered_api_operation}`
    pub name: std::string::String,

    /// Optional. First seen time stamp
    pub first_seen_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Last seen time stamp
    pub last_seen_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The number of occurrences of this API Operation.
    pub count: i64,

    /// Output only. The classification of the discovered API operation.
    pub classification: crate::model::discovered_api_operation::Classification,

    /// Output only. The list of matched results for the discovered API operation.
    /// This will be populated only if the classification is known. The current
    /// usecase is for a single match. Keeping it repeated to support multiple
    /// matches in future.
    pub match_results: std::vec::Vec<crate::model::discovered_api_operation::MatchResult>,

    /// Output only. The metadata of the source from which the api operation was
    /// collected.
    pub source_metadata: std::option::Option<crate::model::SourceMetadata>,

    /// Output only. Create time stamp of the discovered API operation in API Hub.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time stamp of the discovered API operation in API Hub.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// ApiOperation protocol style
    pub operation: std::option::Option<crate::model::discovered_api_operation::Operation>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiscoveredApiOperation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiscoveredApiOperation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [first_seen_time][crate::model::DiscoveredApiOperation::first_seen_time].
    pub fn set_first_seen_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.first_seen_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [first_seen_time][crate::model::DiscoveredApiOperation::first_seen_time].
    pub fn set_or_clear_first_seen_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.first_seen_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [last_seen_time][crate::model::DiscoveredApiOperation::last_seen_time].
    pub fn set_last_seen_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_seen_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [last_seen_time][crate::model::DiscoveredApiOperation::last_seen_time].
    pub fn set_or_clear_last_seen_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.last_seen_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [count][crate::model::DiscoveredApiOperation::count].
    pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.count = v.into();
        self
    }

    /// Sets the value of [classification][crate::model::DiscoveredApiOperation::classification].
    pub fn set_classification<
        T: std::convert::Into<crate::model::discovered_api_operation::Classification>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.classification = v.into();
        self
    }

    /// Sets the value of [match_results][crate::model::DiscoveredApiOperation::match_results].
    pub fn set_match_results<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::discovered_api_operation::MatchResult>,
    {
        use std::iter::Iterator;
        self.match_results = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [source_metadata][crate::model::DiscoveredApiOperation::source_metadata].
    pub fn set_source_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SourceMetadata>,
    {
        self.source_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [source_metadata][crate::model::DiscoveredApiOperation::source_metadata].
    pub fn set_or_clear_source_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SourceMetadata>,
    {
        self.source_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::DiscoveredApiOperation::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::DiscoveredApiOperation::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::DiscoveredApiOperation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::DiscoveredApiOperation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [operation][crate::model::DiscoveredApiOperation::operation].
    ///
    /// Note that all the setters affecting `operation` are mutually
    /// exclusive.
    pub fn set_operation<
        T: std::convert::Into<std::option::Option<crate::model::discovered_api_operation::Operation>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.operation = v.into();
        self
    }

    /// The value of [operation][crate::model::DiscoveredApiOperation::operation]
    /// if it holds a `HttpOperation`, `None` if the field is not set or
    /// holds a different branch.
    pub fn http_operation(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::HttpOperationDetails>> {
        #[allow(unreachable_patterns)]
        self.operation.as_ref().and_then(|v| match v {
            crate::model::discovered_api_operation::Operation::HttpOperation(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [operation][crate::model::DiscoveredApiOperation::operation]
    /// to hold a `HttpOperation`.
    ///
    /// Note that all the setters affecting `operation` are
    /// mutually exclusive.
    pub fn set_http_operation<
        T: std::convert::Into<std::boxed::Box<crate::model::HttpOperationDetails>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.operation = std::option::Option::Some(
            crate::model::discovered_api_operation::Operation::HttpOperation(v.into()),
        );
        self
    }
}

impl wkt::message::Message for DiscoveredApiOperation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiOperation"
    }
}

/// Defines additional types related to [DiscoveredApiOperation].
pub mod discovered_api_operation {
    #[allow(unused_imports)]
    use super::*;

    /// MatchResult represents the result of matching a discovered API operation
    /// with a catalog API operation.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct MatchResult {
        /// Output only. The name of the matched API Operation.
        ///
        /// Format:
        /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
        pub name: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl MatchResult {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::discovered_api_operation::MatchResult::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }
    }

    impl wkt::message::Message for MatchResult {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.DiscoveredApiOperation.MatchResult"
        }
    }

    /// The classification of the discovered API operation.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Classification {
        /// Operation is not classified as known or unknown.
        Unspecified,
        /// Operation has a matched catalog operation.
        Known,
        /// Operation does not have a matched catalog operation.
        Unknown,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Classification::value] or
        /// [Classification::name].
        UnknownValue(classification::UnknownValue),
    }

    #[doc(hidden)]
    pub mod classification {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Classification {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Known => std::option::Option::Some(1),
                Self::Unknown => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CLASSIFICATION_UNSPECIFIED"),
                Self::Known => std::option::Option::Some("KNOWN"),
                Self::Unknown => std::option::Option::Some("UNKNOWN"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Classification {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Classification {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Classification {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Known,
                2 => Self::Unknown,
                _ => Self::UnknownValue(classification::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Classification {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CLASSIFICATION_UNSPECIFIED" => Self::Unspecified,
                "KNOWN" => Self::Known,
                "UNKNOWN" => Self::Unknown,
                _ => Self::UnknownValue(classification::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Classification {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Known => serializer.serialize_i32(1),
                Self::Unknown => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Classification {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Classification>::new(
                ".google.cloud.apihub.v1.DiscoveredApiOperation.Classification",
            ))
        }
    }

    /// ApiOperation protocol style
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Operation {
        /// Optional. An HTTP Operation.
        HttpOperation(std::boxed::Box<crate::model::HttpOperationDetails>),
    }
}

/// An HTTP-based API Operation, sometimes called a "REST" Operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HttpOperationDetails {
    /// Required. An HTTP Operation.
    pub http_operation: std::option::Option<crate::model::HttpOperation>,

    /// Optional. Path params of HttpOperation
    pub path_params: std::vec::Vec<crate::model::http_operation_details::PathParam>,

    /// Optional. Query params of HttpOperation
    pub query_params: std::collections::HashMap<
        std::string::String,
        crate::model::http_operation_details::QueryParam,
    >,

    /// Optional. Request metadata.
    pub request: std::option::Option<crate::model::http_operation_details::HttpRequest>,

    /// Optional. Response metadata.
    pub response: std::option::Option<crate::model::http_operation_details::HttpResponse>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl HttpOperationDetails {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [http_operation][crate::model::HttpOperationDetails::http_operation].
    pub fn set_http_operation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::HttpOperation>,
    {
        self.http_operation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [http_operation][crate::model::HttpOperationDetails::http_operation].
    pub fn set_or_clear_http_operation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::HttpOperation>,
    {
        self.http_operation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [path_params][crate::model::HttpOperationDetails::path_params].
    pub fn set_path_params<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::http_operation_details::PathParam>,
    {
        use std::iter::Iterator;
        self.path_params = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [query_params][crate::model::HttpOperationDetails::query_params].
    pub fn set_query_params<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::http_operation_details::QueryParam>,
    {
        use std::iter::Iterator;
        self.query_params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [request][crate::model::HttpOperationDetails::request].
    pub fn set_request<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::http_operation_details::HttpRequest>,
    {
        self.request = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [request][crate::model::HttpOperationDetails::request].
    pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::http_operation_details::HttpRequest>,
    {
        self.request = v.map(|x| x.into());
        self
    }

    /// Sets the value of [response][crate::model::HttpOperationDetails::response].
    pub fn set_response<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::http_operation_details::HttpResponse>,
    {
        self.response = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [response][crate::model::HttpOperationDetails::response].
    pub fn set_or_clear_response<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::http_operation_details::HttpResponse>,
    {
        self.response = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for HttpOperationDetails {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails"
    }
}

/// Defines additional types related to [HttpOperationDetails].
pub mod http_operation_details {
    #[allow(unused_imports)]
    use super::*;

    /// HTTP Path parameter.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PathParam {
        /// Optional. Segment location in the path, 1-indexed
        pub position: i32,

        /// Optional. Data type of path param
        pub data_type: crate::model::http_operation_details::DataType,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PathParam {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [position][crate::model::http_operation_details::PathParam::position].
        pub fn set_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
            self.position = v.into();
            self
        }

        /// Sets the value of [data_type][crate::model::http_operation_details::PathParam::data_type].
        pub fn set_data_type<
            T: std::convert::Into<crate::model::http_operation_details::DataType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.data_type = v.into();
            self
        }
    }

    impl wkt::message::Message for PathParam {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.PathParam"
        }
    }

    /// An aggregation of HTTP query parameter occurrences.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct QueryParam {
        /// Required. Name of query param
        pub name: std::string::String,

        /// Optional. The number of occurrences of this query parameter across
        /// transactions.
        pub count: i64,

        /// Optional. Data type of path param
        pub data_type: crate::model::http_operation_details::DataType,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl QueryParam {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::http_operation_details::QueryParam::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [count][crate::model::http_operation_details::QueryParam::count].
        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.count = v.into();
            self
        }

        /// Sets the value of [data_type][crate::model::http_operation_details::QueryParam::data_type].
        pub fn set_data_type<
            T: std::convert::Into<crate::model::http_operation_details::DataType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.data_type = v.into();
            self
        }
    }

    impl wkt::message::Message for QueryParam {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.QueryParam"
        }
    }

    /// An aggregation of HTTP header occurrences.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Header {
        /// Header name.
        pub name: std::string::String,

        /// The number of occurrences of this Header across transactions.
        pub count: i64,

        /// Data type of header
        pub data_type: crate::model::http_operation_details::DataType,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Header {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [name][crate::model::http_operation_details::Header::name].
        pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.name = v.into();
            self
        }

        /// Sets the value of [count][crate::model::http_operation_details::Header::count].
        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.count = v.into();
            self
        }

        /// Sets the value of [data_type][crate::model::http_operation_details::Header::data_type].
        pub fn set_data_type<
            T: std::convert::Into<crate::model::http_operation_details::DataType>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.data_type = v.into();
            self
        }
    }

    impl wkt::message::Message for Header {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.Header"
        }
    }

    /// An aggregation of HTTP requests.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HttpRequest {
        /// Optional. Unordered map from header name to header metadata
        pub headers: std::collections::HashMap<
            std::string::String,
            crate::model::http_operation_details::Header,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HttpRequest {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [headers][crate::model::http_operation_details::HttpRequest::headers].
        pub fn set_headers<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<crate::model::http_operation_details::Header>,
        {
            use std::iter::Iterator;
            self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }
    }

    impl wkt::message::Message for HttpRequest {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.HttpRequest"
        }
    }

    /// An aggregation of HTTP responses.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HttpResponse {
        /// Optional. Unordered map from header name to header metadata
        pub headers: std::collections::HashMap<
            std::string::String,
            crate::model::http_operation_details::Header,
        >,

        /// Optional. Map of status code to observed count
        pub response_codes: std::collections::HashMap<i32, i64>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HttpResponse {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [headers][crate::model::http_operation_details::HttpResponse::headers].
        pub fn set_headers<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<crate::model::http_operation_details::Header>,
        {
            use std::iter::Iterator;
            self.headers = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }

        /// Sets the value of [response_codes][crate::model::http_operation_details::HttpResponse::response_codes].
        pub fn set_response_codes<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<i32>,
            V: std::convert::Into<i64>,
        {
            use std::iter::Iterator;
            self.response_codes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }
    }

    impl wkt::message::Message for HttpResponse {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.HttpOperationDetails.HttpResponse"
        }
    }

    /// Type of data
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum DataType {
        /// Unspecified data type
        Unspecified,
        /// Boolean data type
        Bool,
        /// Integer data type
        Integer,
        /// Float data type
        Float,
        /// String data type
        String,
        /// UUID data type
        Uuid,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [DataType::value] or
        /// [DataType::name].
        UnknownValue(data_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod data_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl DataType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Bool => std::option::Option::Some(1),
                Self::Integer => std::option::Option::Some(2),
                Self::Float => std::option::Option::Some(3),
                Self::String => std::option::Option::Some(4),
                Self::Uuid => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
                Self::Bool => std::option::Option::Some("BOOL"),
                Self::Integer => std::option::Option::Some("INTEGER"),
                Self::Float => std::option::Option::Some("FLOAT"),
                Self::String => std::option::Option::Some("STRING"),
                Self::Uuid => std::option::Option::Some("UUID"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for DataType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for DataType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for DataType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Bool,
                2 => Self::Integer,
                3 => Self::Float,
                4 => Self::String,
                5 => Self::Uuid,
                _ => Self::UnknownValue(data_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for DataType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
                "BOOL" => Self::Bool,
                "INTEGER" => Self::Integer,
                "FLOAT" => Self::Float,
                "STRING" => Self::String,
                "UUID" => Self::Uuid,
                _ => Self::UnknownValue(data_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for DataType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Bool => serializer.serialize_i32(1),
                Self::Integer => serializer.serialize_i32(2),
                Self::Float => serializer.serialize_i32(3),
                Self::String => serializer.serialize_i32(4),
                Self::Uuid => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for DataType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
                ".google.cloud.apihub.v1.HttpOperationDetails.DataType",
            ))
        }
    }
}

/// The [CreateCuration][ApiHub.CreateCuration] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCurationRequest {
    /// Required. The parent resource for the curation resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the curation resource, which will become the
    /// final component of the curations's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified ID is already used by another curation resource in the API
    ///   hub.
    /// * If not provided, a system generated ID will be used.
    ///
    /// This value should be 4-500 characters, and valid characters
    /// are /[a-z][A-Z][0-9]-_/.
    pub curation_id: std::string::String,

    /// Required. The curation resource to create.
    pub curation: std::option::Option<crate::model::Curation>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateCurationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateCurationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [curation_id][crate::model::CreateCurationRequest::curation_id].
    pub fn set_curation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.curation_id = v.into();
        self
    }

    /// Sets the value of [curation][crate::model::CreateCurationRequest::curation].
    pub fn set_curation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Curation>,
    {
        self.curation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [curation][crate::model::CreateCurationRequest::curation].
    pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Curation>,
    {
        self.curation = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateCurationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateCurationRequest"
    }
}

/// The [GetCuration][ApiHub.GetCuration] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCurationRequest {
    /// Required. The name of the curation resource to retrieve.
    /// Format: `projects/{project}/locations/{location}/curations/{curation}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetCurationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetCurationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetCurationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetCurationRequest"
    }
}

/// The [UpdateCuration][ApiHub.UpdateCuration] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCurationRequest {
    /// Required. The curation resource to update.
    ///
    /// The curation resource's `name` field is used to identify the curation
    /// resource to update.
    /// Format: `projects/{project}/locations/{location}/curations/{curation}`
    pub curation: std::option::Option<crate::model::Curation>,

    /// Optional. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateCurationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [curation][crate::model::UpdateCurationRequest::curation].
    pub fn set_curation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Curation>,
    {
        self.curation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [curation][crate::model::UpdateCurationRequest::curation].
    pub fn set_or_clear_curation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Curation>,
    {
        self.curation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateCurationRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateCurationRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateCurationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateCurationRequest"
    }
}

/// The [DeleteCuration][ApiHub.DeleteCuration] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCurationRequest {
    /// Required. The name of the curation resource to delete.
    /// Format: `projects/{project}/locations/{location}/curations/{curation}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteCurationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteCurationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteCurationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteCurationRequest"
    }
}

/// The [ListCurations][ApiHub.ListCurations] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCurationsRequest {
    /// Required. The parent, which owns this collection of curation resources.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of curation resources.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. The
    /// comparison operator must be one of: `<`, `>`, `:` or `=`. Filters are case
    /// insensitive.
    ///
    /// The following fields in the `curation resource` are eligible for filtering:
    ///
    /// * `create_time` - The time at which the curation was created.
    ///   The value should be in the (RFC3339)[<https://tools.ietf.org/html/rfc3339>]
    ///   format. Allowed comparison operators: `>` and `<`.
    /// * `display_name` - The display name of the curation. Allowed
    ///   comparison operators: `=`.
    /// * `state` - The state of the curation. Allowed comparison operators: `=`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are supported. At most
    /// three filter fields are allowed in the filter string and if provided
    /// more than that then `INVALID_ARGUMENT` error is returned by the API.
    ///
    /// Here are a few examples:
    ///
    /// * `create_time < \"2021-08-15T14:50:00Z\" AND create_time >
    ///   \"2021-08-10T12:00:00Z\"` -
    ///   The curation resource was created before _2021-08-15 14:50:00 UTC_ and
    ///   after _2021-08-10 12:00:00 UTC_.
    pub filter: std::string::String,

    /// Optional. The maximum number of curation resources to return. The service
    /// may return fewer than this value. If unspecified, at most 50 curations will
    /// be returned. The maximum value is 1000; values above 1000 will be coerced
    /// to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListCurations` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListCurations` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCurationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListCurationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListCurationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListCurationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListCurationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListCurationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListCurationsRequest"
    }
}

/// The [ListCurations][ApiHub.ListCurations] method's response.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCurationsResponse {
    /// The curation resources present in the API hub.
    pub curations: std::vec::Vec<crate::model::Curation>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListCurationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [curations][crate::model::ListCurationsResponse::curations].
    pub fn set_curations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Curation>,
    {
        use std::iter::Iterator;
        self.curations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListCurationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListCurationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListCurationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListCurationsResponse {
    type PageItem = crate::model::Curation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.curations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// A curation resource in the API Hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Curation {
    /// Identifier. The name of the curation.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/curations/{curation}`
    pub name: std::string::String,

    /// Required. The display name of the curation.
    pub display_name: std::string::String,

    /// Optional. The description of the curation.
    pub description: std::string::String,

    /// Required. The endpoint to be triggered for curation.
    pub endpoint: std::option::Option<crate::model::Endpoint>,

    /// Output only. The plugin instances and associated actions that are using the
    /// curation. Note: A particular curation could be used by multiple plugin
    /// instances or multiple actions in a plugin instance.
    pub plugin_instance_actions: std::vec::Vec<crate::model::curation::PluginInstanceActionID>,

    /// Output only. The last execution state of the curation.
    pub last_execution_state: crate::model::curation::LastExecutionState,

    /// Output only. The error code of the last execution of the curation. The
    /// error code is populated only when the last execution state is failed.
    pub last_execution_error_code: crate::model::curation::ErrorCode,

    /// Output only. Error message describing the failure, if any, during the last
    /// execution of the curation.
    pub last_execution_error_message: std::string::String,

    /// Output only. The time at which the curation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time at which the curation was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Curation {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Curation::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Curation::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Curation::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [endpoint][crate::model::Curation::endpoint].
    pub fn set_endpoint<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Endpoint>,
    {
        self.endpoint = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [endpoint][crate::model::Curation::endpoint].
    pub fn set_or_clear_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Endpoint>,
    {
        self.endpoint = v.map(|x| x.into());
        self
    }

    /// Sets the value of [plugin_instance_actions][crate::model::Curation::plugin_instance_actions].
    pub fn set_plugin_instance_actions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::curation::PluginInstanceActionID>,
    {
        use std::iter::Iterator;
        self.plugin_instance_actions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [last_execution_state][crate::model::Curation::last_execution_state].
    pub fn set_last_execution_state<
        T: std::convert::Into<crate::model::curation::LastExecutionState>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.last_execution_state = v.into();
        self
    }

    /// Sets the value of [last_execution_error_code][crate::model::Curation::last_execution_error_code].
    pub fn set_last_execution_error_code<
        T: std::convert::Into<crate::model::curation::ErrorCode>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.last_execution_error_code = v.into();
        self
    }

    /// Sets the value of [last_execution_error_message][crate::model::Curation::last_execution_error_message].
    pub fn set_last_execution_error_message<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.last_execution_error_message = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Curation::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Curation::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Curation::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Curation::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Curation {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Curation"
    }
}

/// Defines additional types related to [Curation].
pub mod curation {
    #[allow(unused_imports)]
    use super::*;

    /// The plugin instance and associated action that is using the curation.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PluginInstanceActionID {
        /// Output only. Plugin instance that is using the curation.
        /// Format is
        /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
        pub plugin_instance: std::string::String,

        /// Output only. The action ID that is using the curation.
        /// This should map to one of the action IDs specified
        /// in action configs in the plugin.
        pub action_id: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PluginInstanceActionID {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [plugin_instance][crate::model::curation::PluginInstanceActionID::plugin_instance].
        pub fn set_plugin_instance<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.plugin_instance = v.into();
            self
        }

        /// Sets the value of [action_id][crate::model::curation::PluginInstanceActionID::action_id].
        pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.action_id = v.into();
            self
        }
    }

    impl wkt::message::Message for PluginInstanceActionID {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.Curation.PluginInstanceActionID"
        }
    }

    /// The state of the last execution of the curation.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum LastExecutionState {
        /// Default unspecified state.
        Unspecified,
        /// The last curation execution was successful.
        Succeeded,
        /// The last curation execution failed.
        Failed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [LastExecutionState::value] or
        /// [LastExecutionState::name].
        UnknownValue(last_execution_state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod last_execution_state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl LastExecutionState {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Succeeded => std::option::Option::Some(1),
                Self::Failed => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("LAST_EXECUTION_STATE_UNSPECIFIED"),
                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for LastExecutionState {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for LastExecutionState {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for LastExecutionState {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Succeeded,
                2 => Self::Failed,
                _ => Self::UnknownValue(last_execution_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for LastExecutionState {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "LAST_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
                "SUCCEEDED" => Self::Succeeded,
                "FAILED" => Self::Failed,
                _ => Self::UnknownValue(last_execution_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for LastExecutionState {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Succeeded => serializer.serialize_i32(1),
                Self::Failed => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for LastExecutionState {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<LastExecutionState>::new(
                ".google.cloud.apihub.v1.Curation.LastExecutionState",
            ))
        }
    }

    /// The error codes for failed executions.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ErrorCode {
        /// Default unspecified error code.
        Unspecified,
        /// The execution failed due to an internal error.
        InternalError,
        /// The curation is not authorized to trigger the endpoint uri.
        Unauthorized,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [ErrorCode::value] or
        /// [ErrorCode::name].
        UnknownValue(error_code::UnknownValue),
    }

    #[doc(hidden)]
    pub mod error_code {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl ErrorCode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::InternalError => std::option::Option::Some(1),
                Self::Unauthorized => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("ERROR_CODE_UNSPECIFIED"),
                Self::InternalError => std::option::Option::Some("INTERNAL_ERROR"),
                Self::Unauthorized => std::option::Option::Some("UNAUTHORIZED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for ErrorCode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for ErrorCode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for ErrorCode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::InternalError,
                2 => Self::Unauthorized,
                _ => Self::UnknownValue(error_code::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for ErrorCode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ERROR_CODE_UNSPECIFIED" => Self::Unspecified,
                "INTERNAL_ERROR" => Self::InternalError,
                "UNAUTHORIZED" => Self::Unauthorized,
                _ => Self::UnknownValue(error_code::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for ErrorCode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::InternalError => serializer.serialize_i32(1),
                Self::Unauthorized => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for ErrorCode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ErrorCode>::new(
                ".google.cloud.apihub.v1.Curation.ErrorCode",
            ))
        }
    }
}

/// The endpoint to be triggered for curation.
/// The endpoint will be invoked with a request payload containing
/// [ApiMetadata][google.cloud.apihub.v1.ApiHub.ApiMetadata].
/// Response should contain curated data in the form of
/// [ApiMetadata][google.cloud.apihub.v1.ApiHub.ApiMetadata].
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Endpoint {
    /// The details of the endpoint to be triggered for curation.
    pub endpoint_details: std::option::Option<crate::model::endpoint::EndpointDetails>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Endpoint {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [endpoint_details][crate::model::Endpoint::endpoint_details].
    ///
    /// Note that all the setters affecting `endpoint_details` are mutually
    /// exclusive.
    pub fn set_endpoint_details<
        T: std::convert::Into<std::option::Option<crate::model::endpoint::EndpointDetails>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.endpoint_details = v.into();
        self
    }

    /// The value of [endpoint_details][crate::model::Endpoint::endpoint_details]
    /// if it holds a `ApplicationIntegrationEndpointDetails`, `None` if the field is not set or
    /// holds a different branch.
    pub fn application_integration_endpoint_details(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>>
    {
        #[allow(unreachable_patterns)]
        self.endpoint_details.as_ref().and_then(|v| match v {
            crate::model::endpoint::EndpointDetails::ApplicationIntegrationEndpointDetails(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [endpoint_details][crate::model::Endpoint::endpoint_details]
    /// to hold a `ApplicationIntegrationEndpointDetails`.
    ///
    /// Note that all the setters affecting `endpoint_details` are
    /// mutually exclusive.
    pub fn set_application_integration_endpoint_details<
        T: std::convert::Into<std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.endpoint_details = std::option::Option::Some(
            crate::model::endpoint::EndpointDetails::ApplicationIntegrationEndpointDetails(
                v.into(),
            ),
        );
        self
    }
}

impl wkt::message::Message for Endpoint {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Endpoint"
    }
}

/// Defines additional types related to [Endpoint].
pub mod endpoint {
    #[allow(unused_imports)]
    use super::*;

    /// The details of the endpoint to be triggered for curation.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum EndpointDetails {
        /// Required. The details of the Application Integration endpoint to be
        /// triggered for curation.
        ApplicationIntegrationEndpointDetails(
            std::boxed::Box<crate::model::ApplicationIntegrationEndpointDetails>,
        ),
    }
}

/// The details of the Application Integration endpoint to be triggered for
/// curation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ApplicationIntegrationEndpointDetails {
    /// Required. The endpoint URI should be a valid REST URI for triggering an
    /// Application Integration. Format:
    /// `<https://integrations.googleapis.com/v1/{name=projects/>*/locations/*/integrations/*}:execute`
    /// or
    /// `https://{location}-integrations.googleapis.com/v1/{name=projects/*/locations/*/integrations/*}:execute`
    pub uri: std::string::String,

    /// Required. The API trigger ID of the Application Integration workflow.
    pub trigger_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ApplicationIntegrationEndpointDetails {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::ApplicationIntegrationEndpointDetails::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [trigger_id][crate::model::ApplicationIntegrationEndpointDetails::trigger_id].
    pub fn set_trigger_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.trigger_id = v.into();
        self
    }
}

impl wkt::message::Message for ApplicationIntegrationEndpointDetails {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ApplicationIntegrationEndpointDetails"
    }
}

/// Message for requesting list of DiscoveredApiObservations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredApiObservationsRequest {
    /// Required. The parent, which owns this collection of ApiObservations.
    /// Format:
    /// projects/{project}/locations/{location}
    pub parent: std::string::String,

    /// Optional. The maximum number of ApiObservations to return. The service may
    /// return fewer than this value. If unspecified, at most 10
    /// ApiObservations will be returned. The maximum value is 1000; values
    /// above 1000 will be coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListApiObservations`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `ListApiObservations` must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredApiObservationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDiscoveredApiObservationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDiscoveredApiObservationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDiscoveredApiObservationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDiscoveredApiObservationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiObservationsRequest"
    }
}

/// Message for response to listing DiscoveredApiObservations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredApiObservationsResponse {
    /// The DiscoveredApiObservation from the specified project and location.
    pub discovered_api_observations: std::vec::Vec<crate::model::DiscoveredApiObservation>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredApiObservationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [discovered_api_observations][crate::model::ListDiscoveredApiObservationsResponse::discovered_api_observations].
    pub fn set_discovered_api_observations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DiscoveredApiObservation>,
    {
        use std::iter::Iterator;
        self.discovered_api_observations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDiscoveredApiObservationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDiscoveredApiObservationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiObservationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDiscoveredApiObservationsResponse {
    type PageItem = crate::model::DiscoveredApiObservation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.discovered_api_observations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for requesting list of DiscoveredApiOperations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredApiOperationsRequest {
    /// Required. The parent, which owns this collection of
    /// DiscoveredApiOperations. Format:
    /// projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}
    pub parent: std::string::String,

    /// Optional. DiscoveredApiOperations will be returned. The maximum value is
    /// 1000; values above 1000 will be coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// `ListDiscoveredApiApiOperations` call. Provide this to retrieve the
    /// subsequent page.
    ///
    /// When paginating, all other parameters provided to
    /// `ListDiscoveredApiApiOperations` must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredApiOperationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDiscoveredApiOperationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDiscoveredApiOperationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDiscoveredApiOperationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDiscoveredApiOperationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiOperationsRequest"
    }
}

/// Message for response to listing DiscoveredApiOperations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredApiOperationsResponse {
    /// The DiscoveredApiOperations from the specified project, location
    /// and DiscoveredApiObservation.
    pub discovered_api_operations: std::vec::Vec<crate::model::DiscoveredApiOperation>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredApiOperationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [discovered_api_operations][crate::model::ListDiscoveredApiOperationsResponse::discovered_api_operations].
    pub fn set_discovered_api_operations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DiscoveredApiOperation>,
    {
        use std::iter::Iterator;
        self.discovered_api_operations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDiscoveredApiOperationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListDiscoveredApiOperationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListDiscoveredApiOperationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDiscoveredApiOperationsResponse {
    type PageItem = crate::model::DiscoveredApiOperation;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.discovered_api_operations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message for requesting a DiscoveredApiObservation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDiscoveredApiObservationRequest {
    /// Required. The name of the DiscoveredApiObservation to retrieve.
    /// Format:
    /// projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDiscoveredApiObservationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDiscoveredApiObservationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDiscoveredApiObservationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetDiscoveredApiObservationRequest"
    }
}

/// Message for requesting a DiscoveredApiOperation
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDiscoveredApiOperationRequest {
    /// Required. The name of the DiscoveredApiOperation to retrieve.
    /// Format:
    /// projects/{project}/locations/{location}/discoveredApiObservations/{discovered_api_observation}/discoveredApiOperations/{discovered_api_operation}
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDiscoveredApiOperationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDiscoveredApiOperationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDiscoveredApiOperationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetDiscoveredApiOperationRequest"
    }
}

/// The
/// [CreateHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration]
/// method's request.
///
/// [google.cloud.apihub.v1.HostProjectRegistrationService.CreateHostProjectRegistration]: crate::client::HostProjectRegistrationService::create_host_project_registration
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateHostProjectRegistrationRequest {
    /// Required. The parent resource for the host project.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Required. The ID to use for the Host Project Registration, which will
    /// become the final component of the host project registration's resource
    /// name. The ID must be the same as the Google cloud project specified in the
    /// host_project_registration.gcp_project field.
    pub host_project_registration_id: std::string::String,

    /// Required. The host project registration to register.
    pub host_project_registration: std::option::Option<crate::model::HostProjectRegistration>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateHostProjectRegistrationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateHostProjectRegistrationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [host_project_registration_id][crate::model::CreateHostProjectRegistrationRequest::host_project_registration_id].
    pub fn set_host_project_registration_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.host_project_registration_id = v.into();
        self
    }

    /// Sets the value of [host_project_registration][crate::model::CreateHostProjectRegistrationRequest::host_project_registration].
    pub fn set_host_project_registration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::HostProjectRegistration>,
    {
        self.host_project_registration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [host_project_registration][crate::model::CreateHostProjectRegistrationRequest::host_project_registration].
    pub fn set_or_clear_host_project_registration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::HostProjectRegistration>,
    {
        self.host_project_registration = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateHostProjectRegistrationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateHostProjectRegistrationRequest"
    }
}

/// The
/// [GetHostProjectRegistration][google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration]
/// method's request.
///
/// [google.cloud.apihub.v1.HostProjectRegistrationService.GetHostProjectRegistration]: crate::client::HostProjectRegistrationService::get_host_project_registration
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetHostProjectRegistrationRequest {
    /// Required. Host project registration resource name.
    /// projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetHostProjectRegistrationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetHostProjectRegistrationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetHostProjectRegistrationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetHostProjectRegistrationRequest"
    }
}

/// The
/// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
/// method's request.
///
/// [google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]: crate::client::HostProjectRegistrationService::list_host_project_registrations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHostProjectRegistrationsRequest {
    /// Required. The parent, which owns this collection of host projects.
    /// Format: `projects/*/locations/*`
    pub parent: std::string::String,

    /// Optional. The maximum number of host project registrations to return. The
    /// service may return fewer than this value. If unspecified, at most 50 host
    /// project registrations will be returned. The maximum value is 1000; values
    /// above 1000 will be coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// `ListHostProjectRegistrations` call. Provide this to retrieve the
    /// subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListHostProjectRegistrations` must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    /// Optional. An expression that filters the list of HostProjectRegistrations.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. All
    /// standard operators as documented at <https://google.aip.dev/160> are
    /// supported.
    ///
    /// The following fields in the `HostProjectRegistration` are eligible for
    /// filtering:
    ///
    /// * `name` - The name of the HostProjectRegistration.
    /// * `create_time` - The time at which the HostProjectRegistration was
    ///   created. The value should be in the
    ///   (RFC3339)[<https://tools.ietf.org/html/rfc3339>] format.
    /// * `gcp_project` - The Google cloud project associated with the
    ///   HostProjectRegistration.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHostProjectRegistrationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListHostProjectRegistrationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListHostProjectRegistrationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListHostProjectRegistrationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListHostProjectRegistrationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListHostProjectRegistrationsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListHostProjectRegistrationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListHostProjectRegistrationsRequest"
    }
}

/// The
/// [ListHostProjectRegistrations][google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]
/// method's response.
///
/// [google.cloud.apihub.v1.HostProjectRegistrationService.ListHostProjectRegistrations]: crate::client::HostProjectRegistrationService::list_host_project_registrations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHostProjectRegistrationsResponse {
    /// The list of host project registrations.
    pub host_project_registrations: std::vec::Vec<crate::model::HostProjectRegistration>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHostProjectRegistrationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [host_project_registrations][crate::model::ListHostProjectRegistrationsResponse::host_project_registrations].
    pub fn set_host_project_registrations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::HostProjectRegistration>,
    {
        use std::iter::Iterator;
        self.host_project_registrations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListHostProjectRegistrationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListHostProjectRegistrationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListHostProjectRegistrationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListHostProjectRegistrationsResponse {
    type PageItem = crate::model::HostProjectRegistration;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.host_project_registrations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Host project registration refers to the registration of a Google cloud
/// project with Api Hub as a host project. This is the project where Api Hub is
/// provisioned. It acts as the consumer project for the Api Hub instance
/// provisioned. Multiple runtime projects can be attached to the host project
/// and these attachments define the scope of Api Hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HostProjectRegistration {
    /// Identifier. The name of the host project registration.
    /// Format:
    /// "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}".
    pub name: std::string::String,

    /// Required. Immutable. Google cloud project name in the format:
    /// "projects/abc" or "projects/123". As input, project name with either
    /// project id or number are accepted. As output, this field will contain
    /// project number.
    pub gcp_project: std::string::String,

    /// Output only. The time at which the host project registration was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl HostProjectRegistration {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::HostProjectRegistration::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [gcp_project][crate::model::HostProjectRegistration::gcp_project].
    pub fn set_gcp_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.gcp_project = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::HostProjectRegistration::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::HostProjectRegistration::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for HostProjectRegistration {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.HostProjectRegistration"
    }
}

/// The [GetStyleGuide][google.cloud.apihub.v1.LintingService.GetStyleGuide]
/// method's request.
///
/// [google.cloud.apihub.v1.LintingService.GetStyleGuide]: crate::client::LintingService::get_style_guide
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetStyleGuideRequest {
    /// Required. The name of the spec to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetStyleGuideRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetStyleGuideRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetStyleGuideRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetStyleGuideRequest"
    }
}

/// The
/// [UpdateStyleGuide][google.cloud.apihub.v1.LintingService.UpdateStyleGuide]
/// method's request.
///
/// [google.cloud.apihub.v1.LintingService.UpdateStyleGuide]: crate::client::LintingService::update_style_guide
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateStyleGuideRequest {
    /// Required. The Style guide resource to update.
    pub style_guide: std::option::Option<crate::model::StyleGuide>,

    /// Optional. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateStyleGuideRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [style_guide][crate::model::UpdateStyleGuideRequest::style_guide].
    pub fn set_style_guide<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::StyleGuide>,
    {
        self.style_guide = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [style_guide][crate::model::UpdateStyleGuideRequest::style_guide].
    pub fn set_or_clear_style_guide<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::StyleGuide>,
    {
        self.style_guide = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateStyleGuideRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateStyleGuideRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateStyleGuideRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdateStyleGuideRequest"
    }
}

/// The
/// [GetStyleGuideContents][google.cloud.apihub.v1.LintingService.GetStyleGuideContents]
/// method's request.
///
/// [google.cloud.apihub.v1.LintingService.GetStyleGuideContents]: crate::client::LintingService::get_style_guide_contents
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetStyleGuideContentsRequest {
    /// Required. The name of the StyleGuide whose contents need to be retrieved.
    /// There is exactly one style guide resource per project per location.
    /// The expected format is
    /// `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetStyleGuideContentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetStyleGuideContentsRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetStyleGuideContentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetStyleGuideContentsRequest"
    }
}

/// The [LintSpec][google.cloud.apihub.v1.LintingService.LintSpec] method's
/// request.
///
/// [google.cloud.apihub.v1.LintingService.LintSpec]: crate::client::LintingService::lint_spec
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LintSpecRequest {
    /// Required. The name of the spec to be linted.
    /// Format:
    /// `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LintSpecRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::LintSpecRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for LintSpecRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.LintSpecRequest"
    }
}

/// The style guide contents.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StyleGuideContents {
    /// Required. The contents of the style guide.
    pub contents: ::bytes::Bytes,

    /// Required. The mime type of the content.
    pub mime_type: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StyleGuideContents {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [contents][crate::model::StyleGuideContents::contents].
    pub fn set_contents<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
        self.contents = v.into();
        self
    }

    /// Sets the value of [mime_type][crate::model::StyleGuideContents::mime_type].
    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.mime_type = v.into();
        self
    }
}

impl wkt::message::Message for StyleGuideContents {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.StyleGuideContents"
    }
}

/// Represents a singleton style guide resource to be used for linting Open API
/// specs.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StyleGuide {
    /// Identifier. The name of the style guide.
    ///
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/styleGuide`
    pub name: std::string::String,

    /// Required. Target linter for the style guide.
    pub linter: crate::model::Linter,

    /// Required. Input only. The contents of the uploaded style guide.
    pub contents: std::option::Option<crate::model::StyleGuideContents>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StyleGuide {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::StyleGuide::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [linter][crate::model::StyleGuide::linter].
    pub fn set_linter<T: std::convert::Into<crate::model::Linter>>(mut self, v: T) -> Self {
        self.linter = v.into();
        self
    }

    /// Sets the value of [contents][crate::model::StyleGuide::contents].
    pub fn set_contents<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::StyleGuideContents>,
    {
        self.contents = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [contents][crate::model::StyleGuide::contents].
    pub fn set_or_clear_contents<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::StyleGuideContents>,
    {
        self.contents = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for StyleGuide {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.StyleGuide"
    }
}

/// A plugin resource in the API Hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Plugin {
    /// Identifier. The name of the plugin.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`
    pub name: std::string::String,

    /// Required. The display name of the plugin. Max length is 50 characters
    /// (Unicode code points).
    pub display_name: std::string::String,

    /// Optional. The type of the API.
    /// This maps to the following system defined attribute:
    /// `projects/{project}/locations/{location}/attributes/system-plugin-type`
    /// attribute.
    /// The number of allowed values for this attribute will be based on the
    /// cardinality of the attribute. The same can be retrieved via GetAttribute
    /// API. All values should be from the list of allowed values defined for the
    /// attribute.
    /// Note this field is not required for plugins developed via plugin framework.
    pub r#type: std::option::Option<crate::model::AttributeValues>,

    /// Optional. The plugin description. Max length is 2000 characters (Unicode
    /// code points).
    pub description: std::string::String,

    /// Output only. Represents the state of the plugin.
    /// Note this field will not be set for plugins developed via plugin
    /// framework as the state will be managed at plugin instance level.
    pub state: crate::model::plugin::State,

    /// Output only. The type of the plugin, indicating whether it is
    /// 'SYSTEM_OWNED' or 'USER_OWNED'.
    pub ownership_type: crate::model::plugin::OwnershipType,

    /// Optional. This field is optional. It is used to notify the plugin hosting
    /// service for any lifecycle changes of the plugin instance and trigger
    /// execution of plugin instance actions in case of API hub managed actions.
    ///
    /// This field should be provided if the plugin instance lifecycle of the
    /// developed plugin needs to be managed from API hub. Also, in this case the
    /// plugin hosting service interface needs to be implemented.
    ///
    /// This field should not be provided if the plugin wants to manage plugin
    /// instance lifecycle events outside of hub interface and use plugin framework
    /// for only registering of plugin and plugin instances to capture the source
    /// of data into hub. Note, in this case the plugin hosting service interface
    /// is not required to be implemented. Also, the plugin instance lifecycle
    /// actions will be disabled from API hub's UI.
    pub hosting_service: std::option::Option<crate::model::plugin::HostingService>,

    /// Optional. The configuration of actions supported by the plugin.
    /// **REQUIRED**: This field must be provided when creating or updating a
    /// Plugin. The server will reject requests if this field is missing.
    pub actions_config: std::vec::Vec<crate::model::PluginActionConfig>,

    /// Optional. The documentation of the plugin, that explains how to set up and
    /// use the plugin.
    pub documentation: std::option::Option<crate::model::Documentation>,

    /// Optional. The category of the plugin, identifying its primary category or
    /// purpose. This field is required for all plugins.
    pub plugin_category: crate::model::PluginCategory,

    /// Optional. The configuration template for the plugin.
    pub config_template: std::option::Option<crate::model::plugin::ConfigTemplate>,

    /// Output only. Timestamp indicating when the plugin was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Timestamp indicating when the plugin was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The type of the gateway.
    pub gateway_type: crate::model::GatewayType,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Plugin {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Plugin::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Plugin::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::Plugin::type].
    pub fn set_type<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.r#type = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [r#type][crate::model::Plugin::type].
    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AttributeValues>,
    {
        self.r#type = v.map(|x| x.into());
        self
    }

    /// Sets the value of [description][crate::model::Plugin::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Plugin::state].
    pub fn set_state<T: std::convert::Into<crate::model::plugin::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [ownership_type][crate::model::Plugin::ownership_type].
    pub fn set_ownership_type<T: std::convert::Into<crate::model::plugin::OwnershipType>>(
        mut self,
        v: T,
    ) -> Self {
        self.ownership_type = v.into();
        self
    }

    /// Sets the value of [hosting_service][crate::model::Plugin::hosting_service].
    pub fn set_hosting_service<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::plugin::HostingService>,
    {
        self.hosting_service = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hosting_service][crate::model::Plugin::hosting_service].
    pub fn set_or_clear_hosting_service<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::plugin::HostingService>,
    {
        self.hosting_service = v.map(|x| x.into());
        self
    }

    /// Sets the value of [actions_config][crate::model::Plugin::actions_config].
    pub fn set_actions_config<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PluginActionConfig>,
    {
        use std::iter::Iterator;
        self.actions_config = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [documentation][crate::model::Plugin::documentation].
    pub fn set_documentation<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [documentation][crate::model::Plugin::documentation].
    pub fn set_or_clear_documentation<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Documentation>,
    {
        self.documentation = v.map(|x| x.into());
        self
    }

    /// Sets the value of [plugin_category][crate::model::Plugin::plugin_category].
    pub fn set_plugin_category<T: std::convert::Into<crate::model::PluginCategory>>(
        mut self,
        v: T,
    ) -> Self {
        self.plugin_category = v.into();
        self
    }

    /// Sets the value of [config_template][crate::model::Plugin::config_template].
    pub fn set_config_template<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::plugin::ConfigTemplate>,
    {
        self.config_template = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [config_template][crate::model::Plugin::config_template].
    pub fn set_or_clear_config_template<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::plugin::ConfigTemplate>,
    {
        self.config_template = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::Plugin::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Plugin::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Plugin::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Plugin::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [gateway_type][crate::model::Plugin::gateway_type].
    pub fn set_gateway_type<T: std::convert::Into<crate::model::GatewayType>>(
        mut self,
        v: T,
    ) -> Self {
        self.gateway_type = v.into();
        self
    }
}

impl wkt::message::Message for Plugin {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.Plugin"
    }
}

/// Defines additional types related to [Plugin].
pub mod plugin {
    #[allow(unused_imports)]
    use super::*;

    /// The information related to the service implemented by the plugin
    /// developer, used to invoke the plugin's functionality.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HostingService {
        /// Optional. The URI of the service implemented by the plugin developer,
        /// used to invoke the plugin's functionality. This information is only
        /// required for user defined plugins.
        pub service_uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HostingService {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [service_uri][crate::model::plugin::HostingService::service_uri].
        pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.service_uri = v.into();
            self
        }
    }

    impl wkt::message::Message for HostingService {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.Plugin.HostingService"
        }
    }

    /// ConfigTemplate represents the configuration template for a plugin.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ConfigTemplate {
        /// Optional. The authentication template for the plugin.
        pub auth_config_template:
            std::option::Option<crate::model::plugin::config_template::AuthConfigTemplate>,

        /// Optional. The list of additional configuration variables for the plugin's
        /// configuration.
        pub additional_config_template: std::vec::Vec<crate::model::ConfigVariableTemplate>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ConfigTemplate {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [auth_config_template][crate::model::plugin::ConfigTemplate::auth_config_template].
        pub fn set_auth_config_template<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::plugin::config_template::AuthConfigTemplate>,
        {
            self.auth_config_template = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [auth_config_template][crate::model::plugin::ConfigTemplate::auth_config_template].
        pub fn set_or_clear_auth_config_template<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::plugin::config_template::AuthConfigTemplate>,
        {
            self.auth_config_template = v.map(|x| x.into());
            self
        }

        /// Sets the value of [additional_config_template][crate::model::plugin::ConfigTemplate::additional_config_template].
        pub fn set_additional_config_template<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::ConfigVariableTemplate>,
        {
            use std::iter::Iterator;
            self.additional_config_template = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for ConfigTemplate {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.Plugin.ConfigTemplate"
        }
    }

    /// Defines additional types related to [ConfigTemplate].
    pub mod config_template {
        #[allow(unused_imports)]
        use super::*;

        /// AuthConfigTemplate represents the authentication template for a plugin.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct AuthConfigTemplate {
            /// Required. The list of authentication types supported by the plugin.
            pub supported_auth_types: std::vec::Vec<crate::model::AuthType>,

            /// Optional. The service account of the plugin hosting service.
            /// This service account should be granted the required permissions on the
            /// Auth Config parameters provided while creating the plugin instances
            /// corresponding to this plugin.
            ///
            /// For example, if the plugin instance auth config requires a secret
            /// manager secret, the service account should be granted the
            /// secretmanager.versions.access permission on the corresponding secret,
            /// if the plugin instance auth config contains a service account, the
            /// service account should be granted the
            /// iam.serviceAccounts.getAccessToken permission on the corresponding
            /// service account.
            pub service_account: std::option::Option<crate::model::GoogleServiceAccountConfig>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl AuthConfigTemplate {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [supported_auth_types][crate::model::plugin::config_template::AuthConfigTemplate::supported_auth_types].
            pub fn set_supported_auth_types<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<crate::model::AuthType>,
            {
                use std::iter::Iterator;
                self.supported_auth_types = v.into_iter().map(|i| i.into()).collect();
                self
            }

            /// Sets the value of [service_account][crate::model::plugin::config_template::AuthConfigTemplate::service_account].
            pub fn set_service_account<T>(mut self, v: T) -> Self
            where
                T: std::convert::Into<crate::model::GoogleServiceAccountConfig>,
            {
                self.service_account = std::option::Option::Some(v.into());
                self
            }

            /// Sets or clears the value of [service_account][crate::model::plugin::config_template::AuthConfigTemplate::service_account].
            pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
            where
                T: std::convert::Into<crate::model::GoogleServiceAccountConfig>,
            {
                self.service_account = v.map(|x| x.into());
                self
            }
        }

        impl wkt::message::Message for AuthConfigTemplate {
            fn typename() -> &'static str {
                "type.googleapis.com/google.cloud.apihub.v1.Plugin.ConfigTemplate.AuthConfigTemplate"
            }
        }
    }

    /// Possible states a plugin can have. Note that this enum may receive new
    /// values in the future. Consumers are advised to always code against the
    /// enum values expecting new states can be added later on.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// The default value. This value is used if the state is omitted.
        Unspecified,
        /// The plugin is enabled.
        Enabled,
        /// The plugin is disabled.
        Disabled,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Enabled => std::option::Option::Some(1),
                Self::Disabled => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Enabled => std::option::Option::Some("ENABLED"),
                Self::Disabled => std::option::Option::Some("DISABLED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Enabled,
                2 => Self::Disabled,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "ENABLED" => Self::Enabled,
                "DISABLED" => Self::Disabled,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Enabled => serializer.serialize_i32(1),
                Self::Disabled => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apihub.v1.Plugin.State",
            ))
        }
    }

    /// Ownership type of the plugin.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum OwnershipType {
        /// Default unspecified type.
        Unspecified,
        /// System owned plugins are defined by API hub and are available out of the
        /// box in API hub.
        SystemOwned,
        /// User owned plugins are defined by the user and need to be explicitly
        /// added to API hub via
        /// [CreatePlugin][google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin] method.
        ///
        /// [google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin]: crate::client::ApiHubPlugin::create_plugin
        UserOwned,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [OwnershipType::value] or
        /// [OwnershipType::name].
        UnknownValue(ownership_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod ownership_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl OwnershipType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::SystemOwned => std::option::Option::Some(1),
                Self::UserOwned => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("OWNERSHIP_TYPE_UNSPECIFIED"),
                Self::SystemOwned => std::option::Option::Some("SYSTEM_OWNED"),
                Self::UserOwned => std::option::Option::Some("USER_OWNED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for OwnershipType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for OwnershipType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for OwnershipType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::SystemOwned,
                2 => Self::UserOwned,
                _ => Self::UnknownValue(ownership_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for OwnershipType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "OWNERSHIP_TYPE_UNSPECIFIED" => Self::Unspecified,
                "SYSTEM_OWNED" => Self::SystemOwned,
                "USER_OWNED" => Self::UserOwned,
                _ => Self::UnknownValue(ownership_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for OwnershipType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::SystemOwned => serializer.serialize_i32(1),
                Self::UserOwned => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for OwnershipType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OwnershipType>::new(
                ".google.cloud.apihub.v1.Plugin.OwnershipType",
            ))
        }
    }
}

/// PluginActionConfig represents the configuration of an action supported by a
/// plugin.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PluginActionConfig {
    /// Required. The id of the action.
    pub id: std::string::String,

    /// Required. The display name of the action.
    pub display_name: std::string::String,

    /// Required. The description of the operation performed by the action.
    pub description: std::string::String,

    /// Required. The trigger mode supported by the action.
    pub trigger_mode: crate::model::plugin_action_config::TriggerMode,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PluginActionConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [id][crate::model::PluginActionConfig::id].
    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.id = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::PluginActionConfig::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::PluginActionConfig::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [trigger_mode][crate::model::PluginActionConfig::trigger_mode].
    pub fn set_trigger_mode<
        T: std::convert::Into<crate::model::plugin_action_config::TriggerMode>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.trigger_mode = v.into();
        self
    }
}

impl wkt::message::Message for PluginActionConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.PluginActionConfig"
    }
}

/// Defines additional types related to [PluginActionConfig].
pub mod plugin_action_config {
    #[allow(unused_imports)]
    use super::*;

    /// Execution mode of the action.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum TriggerMode {
        /// Default unspecified mode.
        Unspecified,
        /// This action can be executed by invoking
        /// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
        /// API with the given action id. To support this, the plugin hosting service
        /// should handle this action id as part of execute call.
        ///
        /// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
        ApiHubOnDemandTrigger,
        /// This action will be executed on schedule by invoking
        /// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
        /// API with the given action id. To set the schedule, the user can provide
        /// the cron expression in the
        /// [PluginAction][PluginAction.schedule_cron_expression] field for a given
        /// plugin instance. To support this, the plugin hosting service should
        /// handle this action id as part of execute call.
        /// Note, on demand execution will be supported by default in this trigger
        /// mode.
        ///
        /// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
        ApiHubScheduleTrigger,
        /// The execution of this plugin is not handled by API hub. In this case,
        /// the plugin hosting service need not handle this action id as part of
        /// the execute call.
        NonApiHubManaged,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [TriggerMode::value] or
        /// [TriggerMode::name].
        UnknownValue(trigger_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod trigger_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl TriggerMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::ApiHubOnDemandTrigger => std::option::Option::Some(1),
                Self::ApiHubScheduleTrigger => std::option::Option::Some(2),
                Self::NonApiHubManaged => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TRIGGER_MODE_UNSPECIFIED"),
                Self::ApiHubOnDemandTrigger => {
                    std::option::Option::Some("API_HUB_ON_DEMAND_TRIGGER")
                }
                Self::ApiHubScheduleTrigger => {
                    std::option::Option::Some("API_HUB_SCHEDULE_TRIGGER")
                }
                Self::NonApiHubManaged => std::option::Option::Some("NON_API_HUB_MANAGED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for TriggerMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for TriggerMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for TriggerMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::ApiHubOnDemandTrigger,
                2 => Self::ApiHubScheduleTrigger,
                3 => Self::NonApiHubManaged,
                _ => Self::UnknownValue(trigger_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for TriggerMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TRIGGER_MODE_UNSPECIFIED" => Self::Unspecified,
                "API_HUB_ON_DEMAND_TRIGGER" => Self::ApiHubOnDemandTrigger,
                "API_HUB_SCHEDULE_TRIGGER" => Self::ApiHubScheduleTrigger,
                "NON_API_HUB_MANAGED" => Self::NonApiHubManaged,
                _ => Self::UnknownValue(trigger_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for TriggerMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::ApiHubOnDemandTrigger => serializer.serialize_i32(1),
                Self::ApiHubScheduleTrigger => serializer.serialize_i32(2),
                Self::NonApiHubManaged => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for TriggerMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TriggerMode>::new(
                ".google.cloud.apihub.v1.PluginActionConfig.TriggerMode",
            ))
        }
    }
}

/// The [GetPlugin][google.cloud.apihub.v1.ApiHubPlugin.GetPlugin] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.GetPlugin]: crate::client::ApiHubPlugin::get_plugin
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPluginRequest {
    /// Required. The name of the plugin to retrieve.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPluginRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPluginRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPluginRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetPluginRequest"
    }
}

/// The [EnablePlugin][google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.EnablePlugin]: crate::client::ApiHubPlugin::enable_plugin
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnablePluginRequest {
    /// Required. The name of the plugin to enable.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EnablePluginRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::EnablePluginRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for EnablePluginRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.EnablePluginRequest"
    }
}

/// The [DisablePlugin][google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.DisablePlugin]: crate::client::ApiHubPlugin::disable_plugin
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisablePluginRequest {
    /// Required. The name of the plugin to disable.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DisablePluginRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DisablePluginRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DisablePluginRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DisablePluginRequest"
    }
}

/// PluginInstanceAction represents an action which can be executed in the plugin
/// instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PluginInstanceAction {
    /// Required. This should map to one of the [action
    /// id][google.cloud.apihub.v1.PluginActionConfig.id] specified in
    /// [actions_config][google.cloud.apihub.v1.Plugin.actions_config] in the
    /// plugin.
    ///
    /// [google.cloud.apihub.v1.Plugin.actions_config]: crate::model::Plugin::actions_config
    /// [google.cloud.apihub.v1.PluginActionConfig.id]: crate::model::PluginActionConfig::id
    pub action_id: std::string::String,

    /// Output only. The current state of the plugin action in the plugin instance.
    pub state: crate::model::plugin_instance_action::State,

    /// Optional. The schedule for this plugin instance action. This can only be
    /// set if the plugin supports API_HUB_SCHEDULE_TRIGGER mode for this action.
    pub schedule_cron_expression: std::string::String,

    /// Optional. This configuration should be provided if the plugin action is
    /// publishing data to API hub curate layer.
    pub curation_config: std::option::Option<crate::model::CurationConfig>,

    /// Optional. The time zone for the schedule cron expression. If not provided,
    /// UTC will be used.
    pub schedule_time_zone: std::string::String,

    /// Optional. The service account used to publish data. Note, the service
    /// account will only be accepted for non GCP plugins like OPDK.
    pub service_account: std::string::String,

    /// Output only. The configuration of resources created for a given plugin
    /// instance action. Note these will be returned only in case of Non-GCP
    /// plugins like OPDK.
    pub resource_config: std::option::Option<crate::model::plugin_instance_action::ResourceConfig>,

    /// The status of the plugin action.
    pub action_status: std::option::Option<crate::model::plugin_instance_action::ActionStatus>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PluginInstanceAction {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [action_id][crate::model::PluginInstanceAction::action_id].
    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.action_id = v.into();
        self
    }

    /// Sets the value of [state][crate::model::PluginInstanceAction::state].
    pub fn set_state<T: std::convert::Into<crate::model::plugin_instance_action::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [schedule_cron_expression][crate::model::PluginInstanceAction::schedule_cron_expression].
    pub fn set_schedule_cron_expression<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.schedule_cron_expression = v.into();
        self
    }

    /// Sets the value of [curation_config][crate::model::PluginInstanceAction::curation_config].
    pub fn set_curation_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CurationConfig>,
    {
        self.curation_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [curation_config][crate::model::PluginInstanceAction::curation_config].
    pub fn set_or_clear_curation_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CurationConfig>,
    {
        self.curation_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [schedule_time_zone][crate::model::PluginInstanceAction::schedule_time_zone].
    pub fn set_schedule_time_zone<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.schedule_time_zone = v.into();
        self
    }

    /// Sets the value of [service_account][crate::model::PluginInstanceAction::service_account].
    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_account = v.into();
        self
    }

    /// Sets the value of [resource_config][crate::model::PluginInstanceAction::resource_config].
    pub fn set_resource_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::plugin_instance_action::ResourceConfig>,
    {
        self.resource_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [resource_config][crate::model::PluginInstanceAction::resource_config].
    pub fn set_or_clear_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::plugin_instance_action::ResourceConfig>,
    {
        self.resource_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [action_status][crate::model::PluginInstanceAction::action_status].
    ///
    /// Note that all the setters affecting `action_status` are mutually
    /// exclusive.
    pub fn set_action_status<
        T: std::convert::Into<std::option::Option<crate::model::plugin_instance_action::ActionStatus>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.action_status = v.into();
        self
    }

    /// The value of [action_status][crate::model::PluginInstanceAction::action_status]
    /// if it holds a `HubInstanceAction`, `None` if the field is not set or
    /// holds a different branch.
    pub fn hub_instance_action(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::ExecutionStatus>> {
        #[allow(unreachable_patterns)]
        self.action_status.as_ref().and_then(|v| match v {
            crate::model::plugin_instance_action::ActionStatus::HubInstanceAction(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [action_status][crate::model::PluginInstanceAction::action_status]
    /// to hold a `HubInstanceAction`.
    ///
    /// Note that all the setters affecting `action_status` are
    /// mutually exclusive.
    pub fn set_hub_instance_action<
        T: std::convert::Into<std::boxed::Box<crate::model::ExecutionStatus>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.action_status = std::option::Option::Some(
            crate::model::plugin_instance_action::ActionStatus::HubInstanceAction(v.into()),
        );
        self
    }
}

impl wkt::message::Message for PluginInstanceAction {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.PluginInstanceAction"
    }
}

/// Defines additional types related to [PluginInstanceAction].
pub mod plugin_instance_action {
    #[allow(unused_imports)]
    use super::*;

    /// The configuration of resources created for a given plugin instance action.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ResourceConfig {
        /// Output only. The type of the action.
        pub action_type: crate::model::ActionType,

        /// Output only. The pubsub topic to publish the data to. Format is
        /// projects/{project}/topics/{topic}
        pub pubsub_topic: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ResourceConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [action_type][crate::model::plugin_instance_action::ResourceConfig::action_type].
        pub fn set_action_type<T: std::convert::Into<crate::model::ActionType>>(
            mut self,
            v: T,
        ) -> Self {
            self.action_type = v.into();
            self
        }

        /// Sets the value of [pubsub_topic][crate::model::plugin_instance_action::ResourceConfig::pubsub_topic].
        pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.pubsub_topic = v.into();
            self
        }
    }

    impl wkt::message::Message for ResourceConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.PluginInstanceAction.ResourceConfig"
        }
    }

    /// State represents the state of the plugin instance action.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Default unspecified state.
        Unspecified,
        /// The action is enabled in the plugin instance i.e., executions can
        /// be triggered for this action.
        Enabled,
        /// The action is disabled in the plugin instance i.e., no executions
        /// can be triggered for this action. This state indicates that the user
        /// explicitly disabled the instance, and no further action is needed unless
        /// the user wants to re-enable it.
        Disabled,
        /// The action in the plugin instance is being enabled.
        Enabling,
        /// The action in the plugin instance is being disabled.
        Disabling,
        /// The ERROR state can come while enabling/disabling plugin instance action.
        /// Users can retrigger enable, disable via
        /// [EnablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]
        /// and
        /// [DisablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]
        /// to restore the action back to enabled/disabled state. Note enable/disable
        /// on actions can only be triggered if plugin instance is in Active state.
        ///
        /// [google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]: crate::client::ApiHubPlugin::disable_plugin_instance_action
        /// [google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]: crate::client::ApiHubPlugin::enable_plugin_instance_action
        Error,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Enabled => std::option::Option::Some(1),
                Self::Disabled => std::option::Option::Some(2),
                Self::Enabling => std::option::Option::Some(3),
                Self::Disabling => std::option::Option::Some(4),
                Self::Error => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Enabled => std::option::Option::Some("ENABLED"),
                Self::Disabled => std::option::Option::Some("DISABLED"),
                Self::Enabling => std::option::Option::Some("ENABLING"),
                Self::Disabling => std::option::Option::Some("DISABLING"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Enabled,
                2 => Self::Disabled,
                3 => Self::Enabling,
                4 => Self::Disabling,
                5 => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "ENABLED" => Self::Enabled,
                "DISABLED" => Self::Disabled,
                "ENABLING" => Self::Enabling,
                "DISABLING" => Self::Disabling,
                "ERROR" => Self::Error,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Enabled => serializer.serialize_i32(1),
                Self::Disabled => serializer.serialize_i32(2),
                Self::Enabling => serializer.serialize_i32(3),
                Self::Disabling => serializer.serialize_i32(4),
                Self::Error => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apihub.v1.PluginInstanceAction.State",
            ))
        }
    }

    /// The status of the plugin action.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum ActionStatus {
        /// Optional. The execution information for the plugin instance action done
        /// corresponding to an API hub instance.
        HubInstanceAction(std::boxed::Box<crate::model::ExecutionStatus>),
    }
}

/// Represents a plugin instance resource in the API Hub.
/// A PluginInstance is a specific instance of a hub plugin with its own
/// configuration, state, and execution details.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PluginInstance {
    /// Identifier. The unique name of the plugin instance resource.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
    pub name: std::string::String,

    /// Required. The display name for this plugin instance. Max length is 255
    /// characters.
    pub display_name: std::string::String,

    /// Optional. The authentication information for this plugin instance.
    pub auth_config: std::option::Option<crate::model::AuthConfig>,

    /// Optional. The additional information for this plugin instance corresponding
    /// to the additional config template of the plugin. This information will be
    /// sent to plugin hosting service on each call to plugin hosted service. The
    /// key will be the config_variable_template.display_name to uniquely identify
    /// the config variable.
    pub additional_config:
        std::collections::HashMap<std::string::String, crate::model::ConfigVariable>,

    /// Output only. The current state of the plugin instance (e.g., enabled,
    /// disabled, provisioning).
    pub state: crate::model::plugin_instance::State,

    /// Output only. Error message describing the failure, if any, during Create,
    /// Delete or ApplyConfig operation corresponding to the plugin instance.This
    /// field will only be populated if the plugin instance is in the ERROR or
    /// FAILED state.
    pub error_message: std::string::String,

    /// Required. The action status for the plugin instance.
    pub actions: std::vec::Vec<crate::model::PluginInstanceAction>,

    /// Output only. Timestamp indicating when the plugin instance was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Timestamp indicating when the plugin instance was last
    /// updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The source project id of the plugin instance. This will be the id
    /// of runtime project in case of gcp based plugins and org id in case of non
    /// gcp based plugins. This field will be a required field for Google provided
    /// on-ramp plugins.
    pub source_project_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PluginInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PluginInstance::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::PluginInstance::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [auth_config][crate::model::PluginInstance::auth_config].
    pub fn set_auth_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AuthConfig>,
    {
        self.auth_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [auth_config][crate::model::PluginInstance::auth_config].
    pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AuthConfig>,
    {
        self.auth_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [additional_config][crate::model::PluginInstance::additional_config].
    pub fn set_additional_config<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::ConfigVariable>,
    {
        use std::iter::Iterator;
        self.additional_config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [state][crate::model::PluginInstance::state].
    pub fn set_state<T: std::convert::Into<crate::model::plugin_instance::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [error_message][crate::model::PluginInstance::error_message].
    pub fn set_error_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.error_message = v.into();
        self
    }

    /// Sets the value of [actions][crate::model::PluginInstance::actions].
    pub fn set_actions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PluginInstanceAction>,
    {
        use std::iter::Iterator;
        self.actions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::PluginInstance::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::PluginInstance::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::PluginInstance::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::PluginInstance::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_project_id][crate::model::PluginInstance::source_project_id].
    pub fn set_source_project_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.source_project_id = v.into();
        self
    }
}

impl wkt::message::Message for PluginInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.PluginInstance"
    }
}

/// Defines additional types related to [PluginInstance].
pub mod plugin_instance {
    #[allow(unused_imports)]
    use super::*;

    /// State represents the state of the plugin instance.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Default unspecified state.
        Unspecified,
        /// The plugin instance is being created.
        Creating,
        /// The plugin instance is active and ready for executions. This is the only
        /// state where executions can run on the plugin instance.
        Active,
        /// The updated config that contains
        /// [additional_config][google.cloud.apihub.v1.PluginInstance.additional_config]
        /// and [auth_config][google.cloud.apihub.v1.PluginInstance.auth_config] is
        /// being applied.
        ///
        /// [google.cloud.apihub.v1.PluginInstance.additional_config]: crate::model::PluginInstance::additional_config
        /// [google.cloud.apihub.v1.PluginInstance.auth_config]: crate::model::PluginInstance::auth_config
        ApplyingConfig,
        /// The ERROR state can come while applying config. Users
        /// can retrigger
        /// [ApplyPluginInstanceConfig][google.cloud.apihub.v1.ApiHubPlugin.ApplyPluginInstanceConfig]
        /// to restore the plugin instance back to active state. Note, In case the
        /// ERROR state happens while applying config (auth_config,
        /// additional_config), the plugin instance will reflect the config which was
        /// trying to be applied while error happened. In order to overwrite, trigger
        /// ApplyConfig with a new config.
        Error,
        /// The plugin instance is in a failed state. This indicates that an
        /// unrecoverable error occurred during a previous operation (Create,
        /// Delete).
        Failed,
        /// The plugin instance is being deleted. Delete is only possible if there is
        /// no other operation running on the plugin instance and plugin instance
        /// action.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::ApplyingConfig => std::option::Option::Some(3),
                Self::Error => std::option::Option::Some(4),
                Self::Failed => std::option::Option::Some(5),
                Self::Deleting => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::ApplyingConfig => std::option::Option::Some("APPLYING_CONFIG"),
                Self::Error => std::option::Option::Some("ERROR"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::ApplyingConfig,
                4 => Self::Error,
                5 => Self::Failed,
                6 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "APPLYING_CONFIG" => Self::ApplyingConfig,
                "ERROR" => Self::Error,
                "FAILED" => Self::Failed,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::ApplyingConfig => serializer.serialize_i32(3),
                Self::Error => serializer.serialize_i32(4),
                Self::Failed => serializer.serialize_i32(5),
                Self::Deleting => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apihub.v1.PluginInstance.State",
            ))
        }
    }
}

/// The curation information for this plugin instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CurationConfig {
    /// Required. The curation type for this plugin instance.
    pub curation_type: crate::model::CurationType,

    /// The curation information for this plugin instance.
    pub curation_config: std::option::Option<crate::model::curation_config::CurationConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CurationConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [curation_type][crate::model::CurationConfig::curation_type].
    pub fn set_curation_type<T: std::convert::Into<crate::model::CurationType>>(
        mut self,
        v: T,
    ) -> Self {
        self.curation_type = v.into();
        self
    }

    /// Sets the value of [curation_config][crate::model::CurationConfig::curation_config].
    ///
    /// Note that all the setters affecting `curation_config` are mutually
    /// exclusive.
    pub fn set_curation_config<
        T: std::convert::Into<std::option::Option<crate::model::curation_config::CurationConfig>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.curation_config = v.into();
        self
    }

    /// The value of [curation_config][crate::model::CurationConfig::curation_config]
    /// if it holds a `CustomCuration`, `None` if the field is not set or
    /// holds a different branch.
    pub fn custom_curation(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::curation_config::CustomCuration>> {
        #[allow(unreachable_patterns)]
        self.curation_config.as_ref().and_then(|v| match v {
            crate::model::curation_config::CurationConfig::CustomCuration(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [curation_config][crate::model::CurationConfig::curation_config]
    /// to hold a `CustomCuration`.
    ///
    /// Note that all the setters affecting `curation_config` are
    /// mutually exclusive.
    pub fn set_custom_curation<
        T: std::convert::Into<std::boxed::Box<crate::model::curation_config::CustomCuration>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.curation_config = std::option::Option::Some(
            crate::model::curation_config::CurationConfig::CustomCuration(v.into()),
        );
        self
    }
}

impl wkt::message::Message for CurationConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CurationConfig"
    }
}

/// Defines additional types related to [CurationConfig].
pub mod curation_config {
    #[allow(unused_imports)]
    use super::*;

    /// Custom curation information for this plugin instance.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct CustomCuration {
        /// Required. The unique name of the curation resource. This will be the name
        /// of the curation resource in the format:
        /// `projects/{project}/locations/{location}/curations/{curation}`
        pub curation: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl CustomCuration {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [curation][crate::model::curation_config::CustomCuration::curation].
        pub fn set_curation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.curation = v.into();
            self
        }
    }

    impl wkt::message::Message for CustomCuration {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.CurationConfig.CustomCuration"
        }
    }

    /// The curation information for this plugin instance.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CurationConfig {
        /// Optional. Custom curation information for this plugin instance.
        CustomCuration(std::boxed::Box<crate::model::curation_config::CustomCuration>),
    }
}

/// The execution status for the plugin instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutionStatus {
    /// Output only. The current state of the execution.
    pub current_execution_state: crate::model::execution_status::CurrentExecutionState,

    /// Output only. The last execution of the plugin instance.
    pub last_execution: std::option::Option<crate::model::execution_status::LastExecution>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExecutionStatus {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [current_execution_state][crate::model::ExecutionStatus::current_execution_state].
    pub fn set_current_execution_state<
        T: std::convert::Into<crate::model::execution_status::CurrentExecutionState>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.current_execution_state = v.into();
        self
    }

    /// Sets the value of [last_execution][crate::model::ExecutionStatus::last_execution].
    pub fn set_last_execution<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::execution_status::LastExecution>,
    {
        self.last_execution = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [last_execution][crate::model::ExecutionStatus::last_execution].
    pub fn set_or_clear_last_execution<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::execution_status::LastExecution>,
    {
        self.last_execution = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExecutionStatus {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ExecutionStatus"
    }
}

/// Defines additional types related to [ExecutionStatus].
pub mod execution_status {
    #[allow(unused_imports)]
    use super::*;

    /// The result of the last execution of the plugin instance.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct LastExecution {
        /// Output only. The result of the last execution of the plugin instance.
        pub result: crate::model::execution_status::last_execution::Result,

        /// Output only. Error message describing the failure, if any, during the
        /// last execution.
        pub error_message: std::string::String,

        /// Output only. The last execution start time of the plugin instance.
        pub start_time: std::option::Option<wkt::Timestamp>,

        /// Output only. The last execution end time of the plugin instance.
        pub end_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl LastExecution {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [result][crate::model::execution_status::LastExecution::result].
        pub fn set_result<
            T: std::convert::Into<crate::model::execution_status::last_execution::Result>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.result = v.into();
            self
        }

        /// Sets the value of [error_message][crate::model::execution_status::LastExecution::error_message].
        pub fn set_error_message<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.error_message = v.into();
            self
        }

        /// Sets the value of [start_time][crate::model::execution_status::LastExecution::start_time].
        pub fn set_start_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.start_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [start_time][crate::model::execution_status::LastExecution::start_time].
        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.start_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [end_time][crate::model::execution_status::LastExecution::end_time].
        pub fn set_end_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.end_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [end_time][crate::model::execution_status::LastExecution::end_time].
        pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.end_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for LastExecution {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.apihub.v1.ExecutionStatus.LastExecution"
        }
    }

    /// Defines additional types related to [LastExecution].
    pub mod last_execution {
        #[allow(unused_imports)]
        use super::*;

        /// Enum for the result of the last execution of the plugin instance.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Result {
            /// Default unspecified execution result.
            Unspecified,
            /// The plugin instance executed successfully.
            Succeeded,
            /// The plugin instance execution failed.
            Failed,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [Result::value] or
            /// [Result::name].
            UnknownValue(result::UnknownValue),
        }

        #[doc(hidden)]
        pub mod result {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl Result {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Succeeded => std::option::Option::Some(1),
                    Self::Failed => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("RESULT_UNSPECIFIED"),
                    Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
                    Self::Failed => std::option::Option::Some("FAILED"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for Result {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for Result {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for Result {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Succeeded,
                    2 => Self::Failed,
                    _ => Self::UnknownValue(result::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for Result {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "RESULT_UNSPECIFIED" => Self::Unspecified,
                    "SUCCEEDED" => Self::Succeeded,
                    "FAILED" => Self::Failed,
                    _ => Self::UnknownValue(result::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for Result {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Succeeded => serializer.serialize_i32(1),
                    Self::Failed => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for Result {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Result>::new(
                    ".google.cloud.apihub.v1.ExecutionStatus.LastExecution.Result",
                ))
            }
        }
    }

    /// Enum for the current state of the execution.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CurrentExecutionState {
        /// Default unspecified execution state.
        Unspecified,
        /// The plugin instance is executing.
        Running,
        /// The plugin instance is not running an execution.
        NotRunning,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [CurrentExecutionState::value] or
        /// [CurrentExecutionState::name].
        UnknownValue(current_execution_state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod current_execution_state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl CurrentExecutionState {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Running => std::option::Option::Some(1),
                Self::NotRunning => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => {
                    std::option::Option::Some("CURRENT_EXECUTION_STATE_UNSPECIFIED")
                }
                Self::Running => std::option::Option::Some("RUNNING"),
                Self::NotRunning => std::option::Option::Some("NOT_RUNNING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for CurrentExecutionState {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for CurrentExecutionState {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for CurrentExecutionState {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Running,
                2 => Self::NotRunning,
                _ => Self::UnknownValue(current_execution_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for CurrentExecutionState {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CURRENT_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
                "RUNNING" => Self::Running,
                "NOT_RUNNING" => Self::NotRunning,
                _ => Self::UnknownValue(current_execution_state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for CurrentExecutionState {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Running => serializer.serialize_i32(1),
                Self::NotRunning => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for CurrentExecutionState {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurrentExecutionState>::new(
                ".google.cloud.apihub.v1.ExecutionStatus.CurrentExecutionState",
            ))
        }
    }
}

/// The [CreatePlugin][google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.CreatePlugin]: crate::client::ApiHubPlugin::create_plugin
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePluginRequest {
    /// Required. The parent resource where this plugin will be created.
    /// Format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Optional. The ID to use for the Plugin resource, which will become the
    /// final component of the Plugin's resource name. This field is optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another Plugin resource in the API hub
    ///   instance.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-63 characters, overall resource name which will be
    /// of format
    /// `projects/{project}/locations/{location}/plugins/{plugin}`,
    /// its length is limited to 1000 characters and valid characters are
    /// /[a-z][A-Z][0-9]-_/.
    pub plugin_id: std::string::String,

    /// Required. The plugin to create.
    pub plugin: std::option::Option<crate::model::Plugin>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreatePluginRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreatePluginRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [plugin_id][crate::model::CreatePluginRequest::plugin_id].
    pub fn set_plugin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.plugin_id = v.into();
        self
    }

    /// Sets the value of [plugin][crate::model::CreatePluginRequest::plugin].
    pub fn set_plugin<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Plugin>,
    {
        self.plugin = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [plugin][crate::model::CreatePluginRequest::plugin].
    pub fn set_or_clear_plugin<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Plugin>,
    {
        self.plugin = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreatePluginRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreatePluginRequest"
    }
}

/// The [DeletePlugin][ApiHub.DeletePlugin] method's request.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePluginRequest {
    /// Required. The name of the Plugin resource to delete.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeletePluginRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeletePluginRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeletePluginRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeletePluginRequest"
    }
}

/// The [ListPlugins][google.cloud.apihub.v1.ApiHubPlugin.ListPlugins] method's
/// request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.ListPlugins]: crate::client::ApiHubPlugin::list_plugins
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPluginsRequest {
    /// Required. The parent resource where this plugin will be created.
    /// Format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of plugins.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. The
    /// comparison operator must be one of: `<`, `>` or
    /// `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `Plugins` are eligible for filtering:
    ///
    /// * `plugin_category` - The category of the Plugin. Allowed
    ///   comparison operators: `=`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are
    /// supported. At most three filter fields are allowed in the filter
    /// string and if provided more than that then `INVALID_ARGUMENT` error is
    /// returned by the API.
    /// Here are a few examples:
    ///
    /// * `plugin_category = ON_RAMP` - The plugin is of category
    ///   on ramp.
    pub filter: std::string::String,

    /// Optional. The maximum number of hub plugins to return. The service may
    /// return fewer than this value. If unspecified, at most 50 hub plugins will
    /// be returned. The maximum value is 1000; values above 1000 will be coerced
    /// to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListPlugins` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListPlugins` must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPluginsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListPluginsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListPluginsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPluginsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPluginsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPluginsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListPluginsRequest"
    }
}

/// The [ListPlugins][google.cloud.apihub.v1.ApiHubPlugin.ListPlugins] method's
/// response.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.ListPlugins]: crate::client::ApiHubPlugin::list_plugins
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPluginsResponse {
    /// The plugins from the specified parent resource.
    pub plugins: std::vec::Vec<crate::model::Plugin>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPluginsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [plugins][crate::model::ListPluginsResponse::plugins].
    pub fn set_plugins<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Plugin>,
    {
        use std::iter::Iterator;
        self.plugins = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPluginsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPluginsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListPluginsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPluginsResponse {
    type PageItem = crate::model::Plugin;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.plugins
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The
/// [CreatePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.CreatePluginInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.CreatePluginInstance]: crate::client::ApiHubPlugin::create_plugin_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePluginInstanceRequest {
    /// Required. The parent of the plugin instance resource.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`
    pub parent: std::string::String,

    /// Optional. The ID to use for the plugin instance, which will become the
    /// final component of the plugin instance's resource name. This field is
    /// optional.
    ///
    /// * If provided, the same will be used. The service will throw an error if
    ///   the specified id is already used by another plugin instance in the plugin
    ///   resource.
    /// * If not provided, a system generated id will be used.
    ///
    /// This value should be 4-63 characters, and valid characters
    /// are /[a-z][A-Z][0-9]-_/.
    pub plugin_instance_id: std::string::String,

    /// Required. The plugin instance to create.
    pub plugin_instance: std::option::Option<crate::model::PluginInstance>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreatePluginInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreatePluginInstanceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [plugin_instance_id][crate::model::CreatePluginInstanceRequest::plugin_instance_id].
    pub fn set_plugin_instance_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.plugin_instance_id = v.into();
        self
    }

    /// Sets the value of [plugin_instance][crate::model::CreatePluginInstanceRequest::plugin_instance].
    pub fn set_plugin_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PluginInstance>,
    {
        self.plugin_instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [plugin_instance][crate::model::CreatePluginInstanceRequest::plugin_instance].
    pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PluginInstance>,
    {
        self.plugin_instance = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreatePluginInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreatePluginInstanceRequest"
    }
}

/// The
/// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutePluginInstanceActionRequest {
    /// Required. The name of the plugin instance to execute.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
    pub name: std::string::String,

    /// Required. The execution details for the action to execute.
    pub action_execution_detail: std::option::Option<crate::model::ActionExecutionDetail>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExecutePluginInstanceActionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ExecutePluginInstanceActionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [action_execution_detail][crate::model::ExecutePluginInstanceActionRequest::action_execution_detail].
    pub fn set_action_execution_detail<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ActionExecutionDetail>,
    {
        self.action_execution_detail = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [action_execution_detail][crate::model::ExecutePluginInstanceActionRequest::action_execution_detail].
    pub fn set_or_clear_action_execution_detail<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ActionExecutionDetail>,
    {
        self.action_execution_detail = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ExecutePluginInstanceActionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ExecutePluginInstanceActionRequest"
    }
}

/// The details for the action to execute.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActionExecutionDetail {
    /// Required. The action id of the plugin to execute.
    pub action_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ActionExecutionDetail {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [action_id][crate::model::ActionExecutionDetail::action_id].
    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.action_id = v.into();
        self
    }
}

impl wkt::message::Message for ActionExecutionDetail {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ActionExecutionDetail"
    }
}

/// The
/// [ExecutePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.ExecutePluginInstanceAction]: crate::client::ApiHubPlugin::execute_plugin_instance_action
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExecutePluginInstanceActionResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ExecutePluginInstanceActionResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for ExecutePluginInstanceActionResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ExecutePluginInstanceActionResponse"
    }
}

/// The
/// [GetPluginInstance][google.cloud.apihub.v1.ApiHubPlugin.GetPluginInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.GetPluginInstance]: crate::client::ApiHubPlugin::get_plugin_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPluginInstanceRequest {
    /// Required. The name of the plugin instance to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPluginInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPluginInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPluginInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetPluginInstanceRequest"
    }
}

/// The
/// [ListPluginInstances][google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]: crate::client::ApiHubPlugin::list_plugin_instances
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPluginInstancesRequest {
    /// Required. The parent resource where this plugin will be created.
    /// Format: `projects/{project}/locations/{location}/plugins/{plugin}`.
    /// To list plugin instances for multiple plugins,
    /// use the - character instead of the plugin ID.
    pub parent: std::string::String,

    /// Optional. An expression that filters the list of plugin instances.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. The
    /// comparison operator must be one of: `<`, `>` or
    /// `=`. Filters are not case sensitive.
    ///
    /// The following fields in the `PluginInstances` are eligible for filtering:
    ///
    /// * `state` - The state of the Plugin Instance. Allowed
    ///   comparison operators: `=`.
    ///
    /// A filter function is also supported in the filter string. The filter
    /// function is `id(name)`. The `id(name)` function returns the id of the
    /// resource name. For example, `id(name) = \"plugin-instance-1\"` is
    /// equivalent to `name =
    /// \"projects/test-project-id/locations/test-location-id/plugins/plugin-1/instances/plugin-instance-1\"`
    /// provided the parent is
    /// `projects/test-project-id/locations/test-location-id/plugins/plugin-1`.
    ///
    /// Expressions are combined with either `AND` logic operator or `OR` logical
    /// operator but not both of them together i.e. only one of the `AND` or `OR`
    /// operator can be used throughout the filter string and both the operators
    /// cannot be used together. No other logical operators are
    /// supported. At most three filter fields are allowed in the filter
    /// string and if provided more than that then `INVALID_ARGUMENT` error is
    /// returned by the API.
    /// Here are a few examples:
    ///
    /// * `state = ENABLED` - The plugin instance is in enabled state.
    pub filter: std::string::String,

    /// Optional. The maximum number of hub plugins to return. The service may
    /// return fewer than this value. If unspecified, at most 50 hub plugins will
    /// be returned. The maximum value is 1000; values above 1000 will be coerced
    /// to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous `ListPluginInstances`
    /// call. Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListPluginInstances`
    /// must match the call that provided the page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPluginInstancesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListPluginInstancesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListPluginInstancesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPluginInstancesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPluginInstancesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPluginInstancesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListPluginInstancesRequest"
    }
}

/// The
/// [ListPluginInstances][google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.ListPluginInstances]: crate::client::ApiHubPlugin::list_plugin_instances
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPluginInstancesResponse {
    /// The plugin instances from the specified parent resource.
    pub plugin_instances: std::vec::Vec<crate::model::PluginInstance>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPluginInstancesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [plugin_instances][crate::model::ListPluginInstancesResponse::plugin_instances].
    pub fn set_plugin_instances<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PluginInstance>,
    {
        use std::iter::Iterator;
        self.plugin_instances = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPluginInstancesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListPluginInstancesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListPluginInstancesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPluginInstancesResponse {
    type PageItem = crate::model::PluginInstance;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.plugin_instances
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The
/// [EnablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]: crate::client::ApiHubPlugin::enable_plugin_instance_action
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnablePluginInstanceActionRequest {
    /// Required. The name of the plugin instance to enable.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
    pub name: std::string::String,

    /// Required. The action id to enable.
    pub action_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EnablePluginInstanceActionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::EnablePluginInstanceActionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [action_id][crate::model::EnablePluginInstanceActionRequest::action_id].
    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.action_id = v.into();
        self
    }
}

impl wkt::message::Message for EnablePluginInstanceActionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.EnablePluginInstanceActionRequest"
    }
}

/// The
/// [EnablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.EnablePluginInstanceAction]: crate::client::ApiHubPlugin::enable_plugin_instance_action
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnablePluginInstanceActionResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl EnablePluginInstanceActionResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for EnablePluginInstanceActionResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.EnablePluginInstanceActionResponse"
    }
}

/// The
/// [DisablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]: crate::client::ApiHubPlugin::disable_plugin_instance_action
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisablePluginInstanceActionRequest {
    /// Required. The name of the plugin instance to disable.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`
    pub name: std::string::String,

    /// Required. The action id to disable.
    pub action_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DisablePluginInstanceActionRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DisablePluginInstanceActionRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [action_id][crate::model::DisablePluginInstanceActionRequest::action_id].
    pub fn set_action_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.action_id = v.into();
        self
    }
}

impl wkt::message::Message for DisablePluginInstanceActionRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DisablePluginInstanceActionRequest"
    }
}

/// The
/// [DisablePluginInstanceAction][google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]
/// method's response.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.DisablePluginInstanceAction]: crate::client::ApiHubPlugin::disable_plugin_instance_action
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisablePluginInstanceActionResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DisablePluginInstanceActionResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for DisablePluginInstanceActionResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DisablePluginInstanceActionResponse"
    }
}

/// The
/// [UpdatePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.UpdatePluginInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.UpdatePluginInstance]: crate::client::ApiHubPlugin::update_plugin_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatePluginInstanceRequest {
    /// Required. The plugin instance to update.
    pub plugin_instance: std::option::Option<crate::model::PluginInstance>,

    /// Optional. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdatePluginInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [plugin_instance][crate::model::UpdatePluginInstanceRequest::plugin_instance].
    pub fn set_plugin_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PluginInstance>,
    {
        self.plugin_instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [plugin_instance][crate::model::UpdatePluginInstanceRequest::plugin_instance].
    pub fn set_or_clear_plugin_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PluginInstance>,
    {
        self.plugin_instance = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdatePluginInstanceRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdatePluginInstanceRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdatePluginInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.UpdatePluginInstanceRequest"
    }
}

/// The
/// [DeletePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.DeletePluginInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.ApiHubPlugin.DeletePluginInstance]: crate::client::ApiHubPlugin::delete_plugin_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePluginInstanceRequest {
    /// Required. The name of the plugin instance to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeletePluginInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeletePluginInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeletePluginInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeletePluginInstanceRequest"
    }
}

/// The
/// [CreateApiHubInstance][google.cloud.apihub.v1.Provisioning.CreateApiHubInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.Provisioning.CreateApiHubInstance]: crate::client::Provisioning::create_api_hub_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateApiHubInstanceRequest {
    /// Required. The parent resource for the Api Hub instance resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. Identifier to assign to the Api Hub instance. Must be unique
    /// within scope of the parent resource. If the field is not provided, system
    /// generated id will be used.
    ///
    /// This value should be 4-40 characters, and valid characters
    /// are `/[a-z][A-Z][0-9]-_/`.
    pub api_hub_instance_id: std::string::String,

    /// Required. The ApiHub instance.
    pub api_hub_instance: std::option::Option<crate::model::ApiHubInstance>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateApiHubInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateApiHubInstanceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [api_hub_instance_id][crate::model::CreateApiHubInstanceRequest::api_hub_instance_id].
    pub fn set_api_hub_instance_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.api_hub_instance_id = v.into();
        self
    }

    /// Sets the value of [api_hub_instance][crate::model::CreateApiHubInstanceRequest::api_hub_instance].
    pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ApiHubInstance>,
    {
        self.api_hub_instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_hub_instance][crate::model::CreateApiHubInstanceRequest::api_hub_instance].
    pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ApiHubInstance>,
    {
        self.api_hub_instance = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateApiHubInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateApiHubInstanceRequest"
    }
}

/// The
/// [DeleteApiHubInstance][google.cloud.apihub.v1.Provisioning.DeleteApiHubInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.Provisioning.DeleteApiHubInstance]: crate::client::Provisioning::delete_api_hub_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteApiHubInstanceRequest {
    /// Required. The name of the Api Hub instance to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteApiHubInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteApiHubInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteApiHubInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteApiHubInstanceRequest"
    }
}

/// The
/// [GetApiHubInstance][google.cloud.apihub.v1.Provisioning.GetApiHubInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.Provisioning.GetApiHubInstance]: crate::client::Provisioning::get_api_hub_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetApiHubInstanceRequest {
    /// Required. The name of the Api Hub instance to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/apiHubInstances/{apiHubInstance}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetApiHubInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetApiHubInstanceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetApiHubInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetApiHubInstanceRequest"
    }
}

/// The
/// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
/// method's request.
///
/// [google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]: crate::client::Provisioning::lookup_api_hub_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupApiHubInstanceRequest {
    /// Required. There will always be only one Api Hub instance for a GCP project
    /// across all locations.
    /// The parent resource for the Api Hub instance resource.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupApiHubInstanceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::LookupApiHubInstanceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }
}

impl wkt::message::Message for LookupApiHubInstanceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.LookupApiHubInstanceRequest"
    }
}

/// The
/// [LookupApiHubInstance][google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]
/// method's response.`
///
/// [google.cloud.apihub.v1.Provisioning.LookupApiHubInstance]: crate::client::Provisioning::lookup_api_hub_instance
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupApiHubInstanceResponse {
    /// API Hub instance for a project if it exists, empty otherwise.
    pub api_hub_instance: std::option::Option<crate::model::ApiHubInstance>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupApiHubInstanceResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [api_hub_instance][crate::model::LookupApiHubInstanceResponse::api_hub_instance].
    pub fn set_api_hub_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ApiHubInstance>,
    {
        self.api_hub_instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [api_hub_instance][crate::model::LookupApiHubInstanceResponse::api_hub_instance].
    pub fn set_or_clear_api_hub_instance<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ApiHubInstance>,
    {
        self.api_hub_instance = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for LookupApiHubInstanceResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.LookupApiHubInstanceResponse"
    }
}

/// The
/// [CreateRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment]
/// method's request.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.CreateRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::create_runtime_project_attachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRuntimeProjectAttachmentRequest {
    /// Required. The parent resource for the Runtime Project Attachment.
    /// Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Required. The ID to use for the Runtime Project Attachment, which will
    /// become the final component of the Runtime Project Attachment's name. The ID
    /// must be the same as the project ID of the Google cloud project specified in
    /// the runtime_project_attachment.runtime_project field.
    pub runtime_project_attachment_id: std::string::String,

    /// Required. The Runtime Project Attachment to create.
    pub runtime_project_attachment: std::option::Option<crate::model::RuntimeProjectAttachment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateRuntimeProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateRuntimeProjectAttachmentRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [runtime_project_attachment_id][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment_id].
    pub fn set_runtime_project_attachment_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.runtime_project_attachment_id = v.into();
        self
    }

    /// Sets the value of [runtime_project_attachment][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment].
    pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
    {
        self.runtime_project_attachment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [runtime_project_attachment][crate::model::CreateRuntimeProjectAttachmentRequest::runtime_project_attachment].
    pub fn set_or_clear_runtime_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
    {
        self.runtime_project_attachment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateRuntimeProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.CreateRuntimeProjectAttachmentRequest"
    }
}

/// The
/// [GetRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment]
/// method's request.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.GetRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::get_runtime_project_attachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRuntimeProjectAttachmentRequest {
    /// Required. The name of the API resource to retrieve.
    /// Format:
    /// `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetRuntimeProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetRuntimeProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetRuntimeProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.GetRuntimeProjectAttachmentRequest"
    }
}

/// The
/// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
/// method's request.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]: crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuntimeProjectAttachmentsRequest {
    /// Required. The parent, which owns this collection of runtime project
    /// attachments. Format: `projects/{project}/locations/{location}`
    pub parent: std::string::String,

    /// Optional. The maximum number of runtime project attachments to return. The
    /// service may return fewer than this value. If unspecified, at most 50
    /// runtime project attachments will be returned. The maximum value is 1000;
    /// values above 1000 will be coerced to 1000.
    pub page_size: i32,

    /// Optional. A page token, received from a previous
    /// `ListRuntimeProjectAttachments` call. Provide this to retrieve the
    /// subsequent page.
    ///
    /// When paginating, all other parameters (except page_size) provided to
    /// `ListRuntimeProjectAttachments` must match the call that provided the page
    /// token.
    pub page_token: std::string::String,

    /// Optional. An expression that filters the list of RuntimeProjectAttachments.
    ///
    /// A filter expression consists of a field name, a comparison
    /// operator, and a value for filtering. The value must be a string. All
    /// standard operators as documented at <https://google.aip.dev/160> are
    /// supported.
    ///
    /// The following fields in the `RuntimeProjectAttachment` are eligible for
    /// filtering:
    ///
    /// * `name` - The name of the RuntimeProjectAttachment.
    /// * `create_time` - The time at which the RuntimeProjectAttachment was
    ///   created. The value should be in the
    ///   (RFC3339)[<https://tools.ietf.org/html/rfc3339>] format.
    /// * `runtime_project` - The Google cloud project associated with the
    ///   RuntimeProjectAttachment.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRuntimeProjectAttachmentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListRuntimeProjectAttachmentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListRuntimeProjectAttachmentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListRuntimeProjectAttachmentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListRuntimeProjectAttachmentsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListRuntimeProjectAttachmentsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListRuntimeProjectAttachmentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsRequest"
    }
}

/// The
/// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
/// method's response.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]: crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuntimeProjectAttachmentsResponse {
    /// List of runtime project attachments.
    pub runtime_project_attachments: std::vec::Vec<crate::model::RuntimeProjectAttachment>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRuntimeProjectAttachmentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [runtime_project_attachments][crate::model::ListRuntimeProjectAttachmentsResponse::runtime_project_attachments].
    pub fn set_runtime_project_attachments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::RuntimeProjectAttachment>,
    {
        use std::iter::Iterator;
        self.runtime_project_attachments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListRuntimeProjectAttachmentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListRuntimeProjectAttachmentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.ListRuntimeProjectAttachmentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRuntimeProjectAttachmentsResponse {
    type PageItem = crate::model::RuntimeProjectAttachment;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.runtime_project_attachments
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The
/// [DeleteRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment]
/// method's request.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.DeleteRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::delete_runtime_project_attachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRuntimeProjectAttachmentRequest {
    /// Required. The name of the Runtime Project Attachment to delete.
    /// Format:
    /// `projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteRuntimeProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteRuntimeProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteRuntimeProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.DeleteRuntimeProjectAttachmentRequest"
    }
}

/// The
/// [LookupRuntimeProjectAttachment][google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment]
/// method's request.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.LookupRuntimeProjectAttachment]: crate::client::RuntimeProjectAttachmentService::lookup_runtime_project_attachment
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupRuntimeProjectAttachmentRequest {
    /// Required. Runtime project ID to look up runtime project attachment for.
    /// Lookup happens across all regions. Expected format:
    /// `projects/{project}/locations/{location}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupRuntimeProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::LookupRuntimeProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for LookupRuntimeProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentRequest"
    }
}

/// The
/// [ListRuntimeProjectAttachments][google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]
/// method's response.
///
/// [google.cloud.apihub.v1.RuntimeProjectAttachmentService.ListRuntimeProjectAttachments]: crate::client::RuntimeProjectAttachmentService::list_runtime_project_attachments
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupRuntimeProjectAttachmentResponse {
    /// Runtime project attachment for a project if exists, empty otherwise.
    pub runtime_project_attachment: std::option::Option<crate::model::RuntimeProjectAttachment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupRuntimeProjectAttachmentResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [runtime_project_attachment][crate::model::LookupRuntimeProjectAttachmentResponse::runtime_project_attachment].
    pub fn set_runtime_project_attachment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
    {
        self.runtime_project_attachment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [runtime_project_attachment][crate::model::LookupRuntimeProjectAttachmentResponse::runtime_project_attachment].
    pub fn set_or_clear_runtime_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::RuntimeProjectAttachment>,
    {
        self.runtime_project_attachment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for LookupRuntimeProjectAttachmentResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse"
    }
}

/// Runtime project attachment represents an attachment from the runtime project
/// to the host project. Api Hub looks for deployments in the attached runtime
/// projects and creates corresponding resources in Api Hub for the discovered
/// deployments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuntimeProjectAttachment {
    /// Identifier. The resource name of a runtime project attachment. Format:
    /// "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment}".
    pub name: std::string::String,

    /// Required. Immutable. Google cloud project name in the format:
    /// "projects/abc" or "projects/123". As input, project name with either
    /// project id or number are accepted. As output, this field will contain
    /// project number.
    pub runtime_project: std::string::String,

    /// Output only. Create time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RuntimeProjectAttachment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RuntimeProjectAttachment::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [runtime_project][crate::model::RuntimeProjectAttachment::runtime_project].
    pub fn set_runtime_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.runtime_project = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::RuntimeProjectAttachment::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::RuntimeProjectAttachment::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RuntimeProjectAttachment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apihub.v1.RuntimeProjectAttachment"
    }
}

/// The type of the collect request.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CollectionType {
    /// The default value. This value is used if the collection type is omitted.
    Unspecified,
    /// The collection type is upsert. This should be used when an API is created
    /// or updated at the source.
    Upsert,
    /// The collection type is delete. This should be used when an API is deleted
    /// at the source.
    Delete,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [CollectionType::value] or
    /// [CollectionType::name].
    UnknownValue(collection_type::UnknownValue),
}

#[doc(hidden)]
pub mod collection_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl CollectionType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Upsert => std::option::Option::Some(1),
            Self::Delete => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("COLLECTION_TYPE_UNSPECIFIED"),
            Self::Upsert => std::option::Option::Some("COLLECTION_TYPE_UPSERT"),
            Self::Delete => std::option::Option::Some("COLLECTION_TYPE_DELETE"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for CollectionType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for CollectionType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for CollectionType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Upsert,
            2 => Self::Delete,
            _ => Self::UnknownValue(collection_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for CollectionType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "COLLECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
            "COLLECTION_TYPE_UPSERT" => Self::Upsert,
            "COLLECTION_TYPE_DELETE" => Self::Delete,
            _ => Self::UnknownValue(collection_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for CollectionType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Upsert => serializer.serialize_i32(1),
            Self::Delete => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for CollectionType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<CollectionType>::new(
            ".google.cloud.apihub.v1.CollectionType",
        ))
    }
}

/// Lint state represents success or failure for linting.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LintState {
    /// Lint state unspecified.
    Unspecified,
    /// Linting was completed successfully.
    Success,
    /// Linting encountered errors.
    Error,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [LintState::value] or
    /// [LintState::name].
    UnknownValue(lint_state::UnknownValue),
}

#[doc(hidden)]
pub mod lint_state {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl LintState {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Success => std::option::Option::Some(1),
            Self::Error => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("LINT_STATE_UNSPECIFIED"),
            Self::Success => std::option::Option::Some("LINT_STATE_SUCCESS"),
            Self::Error => std::option::Option::Some("LINT_STATE_ERROR"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for LintState {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for LintState {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for LintState {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Success,
            2 => Self::Error,
            _ => Self::UnknownValue(lint_state::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for LintState {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "LINT_STATE_UNSPECIFIED" => Self::Unspecified,
            "LINT_STATE_SUCCESS" => Self::Success,
            "LINT_STATE_ERROR" => Self::Error,
            _ => Self::UnknownValue(lint_state::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for LintState {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Success => serializer.serialize_i32(1),
            Self::Error => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for LintState {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LintState>::new(
            ".google.cloud.apihub.v1.LintState",
        ))
    }
}

/// Enumeration of linter types.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Linter {
    /// Linter type unspecified.
    Unspecified,
    /// Linter type spectral.
    Spectral,
    /// Linter type other.
    Other,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [Linter::value] or
    /// [Linter::name].
    UnknownValue(linter::UnknownValue),
}

#[doc(hidden)]
pub mod linter {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl Linter {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Spectral => std::option::Option::Some(1),
            Self::Other => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("LINTER_UNSPECIFIED"),
            Self::Spectral => std::option::Option::Some("SPECTRAL"),
            Self::Other => std::option::Option::Some("OTHER"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for Linter {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for Linter {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for Linter {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Spectral,
            2 => Self::Other,
            _ => Self::UnknownValue(linter::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for Linter {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "LINTER_UNSPECIFIED" => Self::Unspecified,
            "SPECTRAL" => Self::Spectral,
            "OTHER" => Self::Other,
            _ => Self::UnknownValue(linter::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for Linter {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Spectral => serializer.serialize_i32(1),
            Self::Other => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for Linter {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Linter>::new(
            ".google.cloud.apihub.v1.Linter",
        ))
    }
}

/// Severity of the issue.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Severity {
    /// Severity unspecified.
    Unspecified,
    /// Severity error.
    Error,
    /// Severity warning.
    Warning,
    /// Severity info.
    Info,
    /// Severity hint.
    Hint,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [Severity::value] or
    /// [Severity::name].
    UnknownValue(severity::UnknownValue),
}

#[doc(hidden)]
pub mod severity {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl Severity {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Error => std::option::Option::Some(1),
            Self::Warning => std::option::Option::Some(2),
            Self::Info => std::option::Option::Some(3),
            Self::Hint => std::option::Option::Some(4),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
            Self::Error => std::option::Option::Some("SEVERITY_ERROR"),
            Self::Warning => std::option::Option::Some("SEVERITY_WARNING"),
            Self::Info => std::option::Option::Some("SEVERITY_INFO"),
            Self::Hint => std::option::Option::Some("SEVERITY_HINT"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for Severity {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for Severity {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for Severity {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Error,
            2 => Self::Warning,
            3 => Self::Info,
            4 => Self::Hint,
            _ => Self::UnknownValue(severity::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for Severity {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "SEVERITY_UNSPECIFIED" => Self::Unspecified,
            "SEVERITY_ERROR" => Self::Error,
            "SEVERITY_WARNING" => Self::Warning,
            "SEVERITY_INFO" => Self::Info,
            "SEVERITY_HINT" => Self::Hint,
            _ => Self::UnknownValue(severity::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for Severity {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Error => serializer.serialize_i32(1),
            Self::Warning => serializer.serialize_i32(2),
            Self::Info => serializer.serialize_i32(3),
            Self::Hint => serializer.serialize_i32(4),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for Severity {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
            ".google.cloud.apihub.v1.Severity",
        ))
    }
}

/// AuthType represents the authentication type.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AuthType {
    /// Authentication type not specified.
    Unspecified,
    /// No authentication.
    NoAuth,
    /// Google service account authentication.
    GoogleServiceAccount,
    /// Username and password authentication.
    UserPassword,
    /// API Key authentication.
    ApiKey,
    /// Oauth 2.0 client credentials grant authentication.
    Oauth2ClientCredentials,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [AuthType::value] or
    /// [AuthType::name].
    UnknownValue(auth_type::UnknownValue),
}

#[doc(hidden)]
pub mod auth_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl AuthType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::NoAuth => std::option::Option::Some(1),
            Self::GoogleServiceAccount => std::option::Option::Some(2),
            Self::UserPassword => std::option::Option::Some(3),
            Self::ApiKey => std::option::Option::Some(4),
            Self::Oauth2ClientCredentials => std::option::Option::Some(5),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
            Self::NoAuth => std::option::Option::Some("NO_AUTH"),
            Self::GoogleServiceAccount => std::option::Option::Some("GOOGLE_SERVICE_ACCOUNT"),
            Self::UserPassword => std::option::Option::Some("USER_PASSWORD"),
            Self::ApiKey => std::option::Option::Some("API_KEY"),
            Self::Oauth2ClientCredentials => std::option::Option::Some("OAUTH2_CLIENT_CREDENTIALS"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for AuthType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for AuthType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for AuthType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::NoAuth,
            2 => Self::GoogleServiceAccount,
            3 => Self::UserPassword,
            4 => Self::ApiKey,
            5 => Self::Oauth2ClientCredentials,
            _ => Self::UnknownValue(auth_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for AuthType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
            "NO_AUTH" => Self::NoAuth,
            "GOOGLE_SERVICE_ACCOUNT" => Self::GoogleServiceAccount,
            "USER_PASSWORD" => Self::UserPassword,
            "API_KEY" => Self::ApiKey,
            "OAUTH2_CLIENT_CREDENTIALS" => Self::Oauth2ClientCredentials,
            _ => Self::UnknownValue(auth_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for AuthType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::NoAuth => serializer.serialize_i32(1),
            Self::GoogleServiceAccount => serializer.serialize_i32(2),
            Self::UserPassword => serializer.serialize_i32(3),
            Self::ApiKey => serializer.serialize_i32(4),
            Self::Oauth2ClientCredentials => serializer.serialize_i32(5),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for AuthType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
            ".google.cloud.apihub.v1.AuthType",
        ))
    }
}

/// Enum for the plugin category.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PluginCategory {
    /// Default unspecified plugin type.
    Unspecified,
    /// API_GATEWAY plugins represent plugins built for API Gateways like Apigee.
    ApiGateway,
    /// API_PRODUCER plugins represent plugins built for API Producers like
    /// Cloud Run, Application Integration etc.
    ApiProducer,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [PluginCategory::value] or
    /// [PluginCategory::name].
    UnknownValue(plugin_category::UnknownValue),
}

#[doc(hidden)]
pub mod plugin_category {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl PluginCategory {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::ApiGateway => std::option::Option::Some(1),
            Self::ApiProducer => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("PLUGIN_CATEGORY_UNSPECIFIED"),
            Self::ApiGateway => std::option::Option::Some("API_GATEWAY"),
            Self::ApiProducer => std::option::Option::Some("API_PRODUCER"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for PluginCategory {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for PluginCategory {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for PluginCategory {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::ApiGateway,
            2 => Self::ApiProducer,
            _ => Self::UnknownValue(plugin_category::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for PluginCategory {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "PLUGIN_CATEGORY_UNSPECIFIED" => Self::Unspecified,
            "API_GATEWAY" => Self::ApiGateway,
            "API_PRODUCER" => Self::ApiProducer,
            _ => Self::UnknownValue(plugin_category::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for PluginCategory {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::ApiGateway => serializer.serialize_i32(1),
            Self::ApiProducer => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for PluginCategory {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PluginCategory>::new(
            ".google.cloud.apihub.v1.PluginCategory",
        ))
    }
}

/// Enum for the action type.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ActionType {
    /// Default unspecified action type.
    Unspecified,
    /// Action type for sync metadata.
    SyncMetadata,
    /// Action type for sync runtime data.
    SyncRuntimeData,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [ActionType::value] or
    /// [ActionType::name].
    UnknownValue(action_type::UnknownValue),
}

#[doc(hidden)]
pub mod action_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl ActionType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::SyncMetadata => std::option::Option::Some(1),
            Self::SyncRuntimeData => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
            Self::SyncMetadata => std::option::Option::Some("SYNC_METADATA"),
            Self::SyncRuntimeData => std::option::Option::Some("SYNC_RUNTIME_DATA"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for ActionType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for ActionType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for ActionType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::SyncMetadata,
            2 => Self::SyncRuntimeData,
            _ => Self::UnknownValue(action_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for ActionType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
            "SYNC_METADATA" => Self::SyncMetadata,
            "SYNC_RUNTIME_DATA" => Self::SyncRuntimeData,
            _ => Self::UnknownValue(action_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for ActionType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::SyncMetadata => serializer.serialize_i32(1),
            Self::SyncRuntimeData => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for ActionType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
            ".google.cloud.apihub.v1.ActionType",
        ))
    }
}

/// Enum for the gateway type.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum GatewayType {
    /// The gateway type is not specified.
    Unspecified,
    /// The gateway type is Apigee X and Hybrid.
    ApigeeXAndHybrid,
    /// The gateway type is Apigee Edge Public Cloud.
    ApigeeEdgePublicCloud,
    /// The gateway type is Apigee Edge Private Cloud.
    ApigeeEdgePrivateCloud,
    /// The gateway type is Cloud API Gateway.
    CloudApiGateway,
    /// The gateway type is Cloud Endpoints.
    CloudEndpoints,
    /// The gateway type is API Discovery.
    ApiDiscovery,
    /// The gateway type for any other types of gateways.
    Others,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [GatewayType::value] or
    /// [GatewayType::name].
    UnknownValue(gateway_type::UnknownValue),
}

#[doc(hidden)]
pub mod gateway_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl GatewayType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::ApigeeXAndHybrid => std::option::Option::Some(1),
            Self::ApigeeEdgePublicCloud => std::option::Option::Some(2),
            Self::ApigeeEdgePrivateCloud => std::option::Option::Some(3),
            Self::CloudApiGateway => std::option::Option::Some(4),
            Self::CloudEndpoints => std::option::Option::Some(5),
            Self::ApiDiscovery => std::option::Option::Some(6),
            Self::Others => std::option::Option::Some(7),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("GATEWAY_TYPE_UNSPECIFIED"),
            Self::ApigeeXAndHybrid => std::option::Option::Some("APIGEE_X_AND_HYBRID"),
            Self::ApigeeEdgePublicCloud => std::option::Option::Some("APIGEE_EDGE_PUBLIC_CLOUD"),
            Self::ApigeeEdgePrivateCloud => std::option::Option::Some("APIGEE_EDGE_PRIVATE_CLOUD"),
            Self::CloudApiGateway => std::option::Option::Some("CLOUD_API_GATEWAY"),
            Self::CloudEndpoints => std::option::Option::Some("CLOUD_ENDPOINTS"),
            Self::ApiDiscovery => std::option::Option::Some("API_DISCOVERY"),
            Self::Others => std::option::Option::Some("OTHERS"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for GatewayType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for GatewayType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for GatewayType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::ApigeeXAndHybrid,
            2 => Self::ApigeeEdgePublicCloud,
            3 => Self::ApigeeEdgePrivateCloud,
            4 => Self::CloudApiGateway,
            5 => Self::CloudEndpoints,
            6 => Self::ApiDiscovery,
            7 => Self::Others,
            _ => Self::UnknownValue(gateway_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for GatewayType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "GATEWAY_TYPE_UNSPECIFIED" => Self::Unspecified,
            "APIGEE_X_AND_HYBRID" => Self::ApigeeXAndHybrid,
            "APIGEE_EDGE_PUBLIC_CLOUD" => Self::ApigeeEdgePublicCloud,
            "APIGEE_EDGE_PRIVATE_CLOUD" => Self::ApigeeEdgePrivateCloud,
            "CLOUD_API_GATEWAY" => Self::CloudApiGateway,
            "CLOUD_ENDPOINTS" => Self::CloudEndpoints,
            "API_DISCOVERY" => Self::ApiDiscovery,
            "OTHERS" => Self::Others,
            _ => Self::UnknownValue(gateway_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for GatewayType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::ApigeeXAndHybrid => serializer.serialize_i32(1),
            Self::ApigeeEdgePublicCloud => serializer.serialize_i32(2),
            Self::ApigeeEdgePrivateCloud => serializer.serialize_i32(3),
            Self::CloudApiGateway => serializer.serialize_i32(4),
            Self::CloudEndpoints => serializer.serialize_i32(5),
            Self::ApiDiscovery => serializer.serialize_i32(6),
            Self::Others => serializer.serialize_i32(7),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for GatewayType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<GatewayType>::new(
            ".google.cloud.apihub.v1.GatewayType",
        ))
    }
}

/// Enum for the curation type.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CurationType {
    /// Default unspecified curation type.
    Unspecified,
    /// Default curation for API metadata will be used.
    DefaultCurationForApiMetadata,
    /// Custom curation for API metadata will be used.
    CustomCurationForApiMetadata,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [CurationType::value] or
    /// [CurationType::name].
    UnknownValue(curation_type::UnknownValue),
}

#[doc(hidden)]
pub mod curation_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl CurationType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::DefaultCurationForApiMetadata => std::option::Option::Some(1),
            Self::CustomCurationForApiMetadata => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("CURATION_TYPE_UNSPECIFIED"),
            Self::DefaultCurationForApiMetadata => {
                std::option::Option::Some("DEFAULT_CURATION_FOR_API_METADATA")
            }
            Self::CustomCurationForApiMetadata => {
                std::option::Option::Some("CUSTOM_CURATION_FOR_API_METADATA")
            }
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for CurationType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for CurationType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for CurationType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::DefaultCurationForApiMetadata,
            2 => Self::CustomCurationForApiMetadata,
            _ => Self::UnknownValue(curation_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for CurationType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "CURATION_TYPE_UNSPECIFIED" => Self::Unspecified,
            "DEFAULT_CURATION_FOR_API_METADATA" => Self::DefaultCurationForApiMetadata,
            "CUSTOM_CURATION_FOR_API_METADATA" => Self::CustomCurationForApiMetadata,
            _ => Self::UnknownValue(curation_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for CurationType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::DefaultCurationForApiMetadata => serializer.serialize_i32(1),
            Self::CustomCurationForApiMetadata => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for CurationType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<CurationType>::new(
            ".google.cloud.apihub.v1.CurationType",
        ))
    }
}
